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