in reply to I've read perlref
and why you can only return one value from a subroutine?
You can return as many values as you like from a sub in list context. How do you think split etc work?
why perl uses references to pass arrays?
Because it's easier... and more efficient. It's also the best way to return multple arrays from a sub... return \@a1, \@a2;
UPDATE: just noticed that you have not QUOTED your array values... and values is a perl keyword!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I've read perlref
by Abigail-II (Bishop) on Mar 11, 2004 at 11:34 UTC | |
by Anonymous Monk on Mar 11, 2004 at 11:46 UTC | |
by Corion (Patriarch) on Mar 11, 2004 at 12:04 UTC |