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

Are you attempting to just pass a list of variables all at once?

If so, just stack them up and they arrive to the subroutine as a simple @array. you can then loop inside the subroutine.

# these vars could come from a cgi form my $c1 = "foo"; my $c2 = "fee"; my $c3 = "fuu"; doThis($c1, $c2, $c3); sub doThis { foreach (@_ ) { print; } }

Update: My original reply didn't show up at first, so I redid the darn this, now I have two...apologies

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