in reply to Re: File Sorting Question
in thread File Sorting Question

You'll find that your s/// has changed your original data. And your 'sorted' array no longer has the word 'The'.

Update:And your map is a 'funny' way to write (thanks for pointing out another bug :-):

for (@array) { my $num = s/^The //; push @temp, $num; }
which DOES modify the original @array. And doesn't put the desired value into @temp ($num is the number of substitutions, which is 0 (undef) or 1).

Replies are listed 'Best First'.
Re: Re: Re: File Sorting Question
by tye (Sage) on Jun 19, 2001 at 10:46 UTC
    s/^The\s+// for @temp= @array;         - tye (but my friends call me "Tye")