in reply to array sorting
print join(" ", sort @animals);
Or you could do this:
{ local $, = " "; print sort( @animals ); }
The latter method has the advantage of not creating a temporary second copy of the array in the form of a string as the result of join. This second method simply uses the list separator special variable $, to put a space between each list element as it is printed.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array sorting
by Abigail-II (Bishop) on Jan 29, 2004 at 10:17 UTC | |
by davido (Cardinal) on Jan 29, 2004 at 17:41 UTC |