McMahon has asked for the wisdom of the Perl Monks concerning the following question:
my @sorted = map{ substr $_, 5; } sort { $b cmp $a } map{ sprintf '%05d%s', $_ =~ m[,\s+(\d+)], $_; } @msgs; #SOME STUFF foreach my $warning(@sorted) { print OUT $warning unless ($warning =~ "<stuff I don't want>"); }
Use of uninitialized value in sprintf at script.pl line 43, <LOG> line + 7253. Argument <line from LOG> isn't numeric in sprintf at script.pl line 43 +, <LOG> line 7253
my @sorted = map{ substr $_, 125; } sort { $b cmp $a } map{ sprintf '%0125d%s', $_ =~ m[,\s+(\d+)], $_; } @msgs;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What is sprintf doing?
by Roy Johnson (Monsignor) on May 25, 2004 at 15:31 UTC | |
|
Re: What is sprintf doing?
by Nkuvu (Priest) on May 25, 2004 at 15:31 UTC | |
|
Re: What is sprintf doing?
by halley (Prior) on May 25, 2004 at 16:44 UTC | |
|
Re: What is sprintf doing?
by BrowserUk (Patriarch) on May 25, 2004 at 17:38 UTC | |
by McMahon (Chaplain) on May 25, 2004 at 18:10 UTC | |
by BrowserUk (Patriarch) on May 25, 2004 at 18:28 UTC | |
by McMahon (Chaplain) on May 25, 2004 at 18:46 UTC |