Note: forwarded message attached.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--- Begin Message ---
Hi,

I have written a simple script that does numeric or
ascii sort based on the command line args. When I run
it, my output is ok but I get the warning 
"Argument "\x{a}" isn't numeric in sort at sort.pl
line 19, <FIN> line 8."

This is my script

#!/usr/bin/perl
use strict;
use warnings;

my $numeric = 0;
my $input = shift;
if($input eq "-n"){
    $numeric = 1;
    $input = shift;
}

open FIN, $input  or die "couldn't open $input for
read $!\n";


my @file = <FIN>;
if($numeric){
    @file = sort {$a <=> $b} @file;
}
else{
    @file = sort @file;
}

print @file;

Can anyone let me know what's the problem?

Thanks,
Anu.


                
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


--- End Message ---
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to