in reply to Sending Information to Sub
I am sure many others will most faster, cooler, and more elegant ways.. but that works, and is easy to read.some("Foo", "Bar"); sub some { my ($one, $two) = @_; }
Update: Maybe I wasn't reading that right the first time.. I think you maybe wanted to send a scalar as one argument, and an array (just examples) as the other? In any event, it would work the same:
my @alphabet = ('A' .. 'Z'); some("Foo", @alphabet); sub some { my ($one, @alpha) = @_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Sne ding Information to Sub
by dvergin (Monsignor) on Jun 26, 2002 at 19:13 UTC |