Nymn has asked for the wisdom of the Perl Monks concerning the following question:
I know to put in#!/usr/bin/perl # @names = qw { steve Mary alice Robert MARVIN kENneth tiM } ; # foreach $name (@names) { print "Name = $name\n" ; } ; # print "\nSorted names 1 \n" ; # New code to sort and print names goes here.
Is there a way to get the names in order? I tried the codes, but all I got was:sort @names foreach $name (@names) { print "Name: $name \n" ; } ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting names
by swampyankee (Parson) on Dec 20, 2006 at 18:08 UTC | |
|
Re: Sorting names
by jettero (Monsignor) on Dec 20, 2006 at 18:03 UTC | |
|
Re: Sorting names
by leighsharpe (Monk) on Dec 20, 2006 at 23:15 UTC |