in reply to Unwanted interpolation in backquoted string
use IO::File; ... my $good = getvalue($file, $vals[0]); ... sub getvalue { my ($file, $val) = @_; my $val; my $f = new IO::File $file, "r" or die "Can not open file"; while (my $line = <$f>) { if ($line =~ /$val/) { return (split /,/, $line)[1]; # return 2nd field } } return undef; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Unwanted interpolation in backquoted string
by graff (Chancellor) on May 04, 2004 at 12:00 UTC | |
by jdporter (Paladin) on May 04, 2004 at 22:11 UTC | |
by Roger (Parson) on May 04, 2004 at 13:12 UTC | |
|
Re: Re: Unwanted interpolation in backquoted string
by mhearse (Chaplain) on May 04, 2004 at 06:44 UTC |