open (CINGULAR, "c:/documents and Settings/david price/my documents/cingular.txt") || die "cannot open: $!"; @number=; close (CINGULAR); # Remove the following commented lines # $count=0; # while ($count<100) { # if (@number=~/^9432$/g) { # print "match found"; } # else { # print "match failed"; # } # $count++; # } # and change them to: foreach $line ( @number ) { if ( $line =~ /^9432$/g ) { print "Match found\n"; } else { print "Match failed\n"; } }