truthseeker66 has asked for the wisdom of the Perl Monks concerning the following question:
When I execute this I expect see 'five-@-four-@-one-@-three-@-two'
#!/usr/bin/perl use strict; use warnings; my@array = qw(one two three four five); print "The original array contains @array \n\n"; my$string = join ("-@-", sort@array); print "The string contains $string \n";
But why do I see? 'The string contains five-four-one-three-two'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Join function
by toolic (Bishop) on Oct 09, 2012 at 20:29 UTC | |
by truthseeker66 (Novice) on Oct 10, 2012 at 13:16 UTC |