Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: passing more than one parameter

by TrekNoid (Pilgrim)
on Aug 12, 2004 at 19:21 UTC ( [id://382437]=note: print w/replies, xml ) Need Help??


in reply to passing more than one parameter

This is actually the first ever program I wrote in Perl, so I *know* there's got to be a better way to do it, since it seems that there's always a better way than the first way I did everything :)... but adapting it from your code snippets, if your call is:
<a href=/cgi-bin/test.pl?hello=2&hai=3>TEST</a>
and you want test.pl to put the 'hello' in $test1 and 'hai' in $test2, then the following code in test.pl *should* get close to what you're after:
$params = $ARGV[0]; ($test1, $test2) = split('&', $ARGV[0]);
Although, technically, that will assign 'hello=2' to $test1 and 'hai=3' to $test2... but you should be able to split those off pretty easily

I haven't tested it with an ampersand, but I know that it worked in my early app, which used the colon ':' as a separator...

Trek

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://382437]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found