Hi ,

I am using following code 

#!/usr/local/bin/perl

 # Main program
 
 use warnings;
 use strict;

 my $file = "c:\backup.pl";
 open(FH,$file) || die " can't open a file";
 my $pattern = '\w\s\w';
 my $input = <>;
 print "yes got the match " if $input =~ /$pattern/;

but  i am getting following error

Name "main::FH" used only once: possible typo at C:\irfan\search.pl line 
9.
 can't open a file at C:\irfan\search.pl line 9.

can anybody plz help me out

Regards
Irfan Sayed

 

Reply via email to