Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

(ar0n) Re: CGI.pm: Can param return array ref?

by ar0n (Priest)
on Jul 13, 2001 at 22:10 UTC ( [id://96505]=note: print w/replies, xml ) Need Help??


in reply to CGI.pm: Can param return array ref?

my $value = @{ [ $q->param('foo') ] } > 1 ? [ $q->param('foo') ] : $q- +>param('foo');

The above snippet creates an array ref and then derefences it, so it can check the number of elements. If it's greater than one, it creates array ref.

ar0n ]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-25 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found