in reply to Re: Re: Re: advice for reading data from a file
in thread advice for reading data from a file
use strict; my @fields; my $RS = ' '; my $rv = &do_this; print $rv; sub do_this { while(<DATA>){ next unless $. == 2; @fields = ( split /$RS/, $_ ), last if $. == 2; @fields = ( split /$RS/, $_ ), last if $. == 2; } return $fields[2] =~ /\d+/; } __DATA__ This is line one. I found 12 on line two. And This was found on line three.
|
|---|