Calling Subroutines in CGI

They have: 10 posts

Joined: Feb 2004

i am working on a basic PERL CGI script and i am using a subroutine called "guestbook" using
&guestbook'
i can execute the subroutine.

but i was wondering how do i access the subroutine via the browser??

He has: 51 posts

Joined: Jan 2004

To call the script, you can reference it by url:

.. .com/cgi-bin/yourscriptname.cgi

In the script you call your subroutine.

However, you can read about it in more detail at
http://www.cgi101.com/book/ch1/text.html

Let us know how it turns out!

Hector

They have: 10 posts

Joined: Feb 2004

what im after actually is to be able to process a small part of my script for example if i type mysite.com/cgi-bin/scriptname.cgi?admin if displays a different thing compared to if i type mysite.com/cgi-bin/scriptname.cgi

He has: 51 posts

Joined: Jan 2004

You need a module like CGI.pm
Take a look at http://search.cpan.org/dist/CGI.pm/
It will allow you to do what you're after.

[This is covered in the link I first gave you!]

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.