Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: parse problem

by DrManhattan (Chaplain)
on Apr 20, 2003 at 02:05 UTC ( [id://251761] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    my $data = 'gi|12345678|ref|NP_001234.1|';
    my @data = split /\|/, $data;
    my $number = $data[1];
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    
    my $data = 'gi|12345678|ref|NP_001234.1|';
    my $number = (split(/\|/, $data))[1];