#!/usr/local/bin/perl use strict; use warnings; my %hash; @hash{qw(one three)} = undef; while(my $var1 = <DATA>){ chomp $var1; if (exists $hash{$var1}) { print "line is $.\n"; } } __DATA__ one two three four
In reply to Re: comparing array vs file
by cdarke
in thread comparing array vs file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |