Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How do I pass a sequence of variable names to a subroutine one at a time?

by ar0n (Priest)
on Oct 06, 2000 at 00:55 UTC ( #35475=note: print w/replies, xml ) Need Help??


in reply to How do I pass a sequence of variable names to a subroutine one at a time?

How about:
use strict; foreach ($query->param) { do_stuff($_) if /^c\d+$/; } sub do_stuff() { my $cd = shift; my $value = $query->param($cd); # blah }
param() returns the names of all the parameters when called with any arguments. See the CGI docs.

Originally posted as a Categorized Answer.

  • Comment on Re: How do I pass a sequence of variable names to a subroutine one at a time?
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2023-03-24 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?