perlfan99 has asked for the wisdom of the Perl Monks concerning the following question:
sub test1 { my ($data) = @_; print "test1 data = $data\n"; } sub test2 { my $data = @_; print "test2 data = $data\n"; } test1("hello"); test2("hello"); test2( qw(hello world) ); OUTPUT: test1 data = hello test2 data = 1 test2 data = 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: function parameter assignment question
by GrandFather (Saint) on Jul 18, 2008 at 04:17 UTC | |
|
Re: function parameter assignment question
by ikegami (Patriarch) on Jul 18, 2008 at 04:31 UTC | |
by perlfan99 (Sexton) on Jul 18, 2008 at 04:37 UTC | |
by Anonymous Monk on Jul 18, 2008 at 12:42 UTC | |
|
Re: function parameter assignment question
by blazar (Canon) on Jul 19, 2008 at 19:08 UTC |