my $word = pop; #what is this for?
open(FH, "$file") or die "$!";
while (my $line = <FH>)
{
if ($line =~ m/foo/)
{
print "matched!";
next;
}
print "unmatched :(";
}
close(FH);
On 6/2/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote:
Hi All,
I am using following code
#!/usr/local/bin/perl
# Main program
use warnings;
use strict;
use File::Find;
my $file = 'c:\\backup.pl';
open (FH, $file);
my ($line);
my $word = pop;
while ($line = <FH>)
{
if ($line =~/$word/)
{
print "match found";
}
else
{
print "match not found";
}
}
close FH;
Following is the error
readline() on closed filehandle FH at C:\irfan\search.pl line 13.
can anybody plz help
Regards
Irfan Sayed
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>