Kevin Viel wrote:
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?

my ( $chr ) = $value =~ /_chr(\d+)_/i;



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

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


Reply via email to