in reply to help manipulating data in an array.

Others pointed out the mistakes with the match. I shall talk further improvements. Here's how I would do it:

use strict; use diagnostics; open my $fh, "<c:/documents and Settings/david price/my documents/cing +ular.txt" or die "cannot open for reading: $!"; my $matches; while (<$fh>) { $matches++ if /9432$/; last if $. == 100; # skip to end of while once we have reached line 100 # $. is a built-in variable, see perlvar in the docs }; close $fh; print "Found $matches matches.\n";