in reply to advice for reading data from a file
sub check_field { my $file_name = shift; open my $fh, "<$file_name" or die "*** ERROR opening '$file_name': $!"; my @fields = (); while (defined (<$fh>)) { if ($. == 2) { chomp; @fields = split /;/; return 0 unless $#fields == 3; last; } } return 0 if $#fields < 0; return $fields[2] =~ /^\d+$/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: advice for reading data from a file
by Anonymous Monk on Jan 19, 2004 at 00:39 UTC | |
by Roger (Parson) on Jan 19, 2004 at 00:51 UTC | |
by Anonymous Monk on Jan 19, 2004 at 01:04 UTC | |
by Roger (Parson) on Jan 19, 2004 at 01:30 UTC | |
by graff (Chancellor) on Jan 19, 2004 at 03:54 UTC | |
| |
|
Re: Re: advice for reading data from a file
by graff (Chancellor) on Jan 19, 2004 at 01:21 UTC |