wrote in message news:<. com>...
I tried running this program and it comes up with an error. What part
of it is incorrect:
use strict;
use warnings;
my ( $buffer , @fields , $filename , %hash1 );
$filename = 'C:\Documents and Settings\vhlab\Desktop\doc.txt';
open(INPUT,"<$filename") or
die("Can't open file \"$filename\" : $!\n");
%hash1 = ( "ytkyk" => 1 , "ghjhg" => 1 );
while ( $buffer = <INPUT> ) {
chomp $buffer;
@fields = split(/\t+/,$buffer);
if ( 2 < @fields ) { # Ignore if less than 3 fields
next;
}
unless ( exists $hash1{$fields[2]} ) {
next;
} print "$buffer\n";
}
close INPUT;
Thank you.