in reply to Re: Searching for Certain Values
in thread Searching for Certain Values

You are probably running an elderly version of Perl. What do you get when you run /usr/local/bin/perl -v on the command line? The three-argument form of open was introduced in Perl 5.6 according to perl56delta as were lexical filehandles (the my $fh). If you are running an earlier version then change

open(my $fh, "<", "data.txt") || die "Can't open file: $!";

to

open (FH, '<data.txt') || die "Can't open file: $!";

and

while(my $line = <$fh>) {

to

while(my $line = <FH>) {

You may want to consider upgrading your version of Perl as 5.005 is positively ancient.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^3: Searching for Certain Values
by Dr.Avocado (Novice) on Jul 30, 2007 at 22:47 UTC
    That ought to do it, as I am running the ancient Perl v. 5.005. Thanks! I'll get an update ASAP.