Happy New Year.

I have a series of values with the following form:

TO_Chr10_final.txt

I would like to obtain the value 10, for accounting purposes:

my $chr = ( split /_/ , $value ) [ 1 ] ;
$chr =~ /chr/i ;

$chr = $' ;

This seems convoluted.  Could someone please criticize this approach or
offer a better one?
-

yes there is many ways, but I like this one.

$ perl -le 'my $str=qq(TO_Chr10_final.txt); my @arr = unpack("A2" x 
(length($str) >> 1), $str); print grep {/^\d+$/} @arr;'
10

Does that help?
: )





      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to