in reply to Checking Arrays


A lot of the other replies show how you can process the data after you've read it. But perhaps it might be better to process that data as you read it. Like this:
#!/usr/bin/perl -w use strict; my @search; my $query = qr/perl/; open FILE, "file" or die "Error message here: $!"; while (<FILE>) { push @search, $_ if /$query/; } chomp @search; # If required close(FILE);

Also, the qr// operator is useful for pre-compliling a regular expression that will be used as a variable. See perlop for details.

--
John.