great it's working fine 

thanks

Regards
Irfan Sayed

 



<[EMAIL PROTECTED]> 
06/02/2006 05:24 PM

To
Irfan J Sayed/India/[EMAIL PROTECTED]
cc

Subject
RE: searching word in script







Use '||' instead of '|'.

-----Original Message-----
From: Irfan J Sayed [mailto:[EMAIL PROTECTED]

Sent: Friday, June 02, 2006 5:20 PM
To: beginners@perl.org
Subject: RE: searching word in script

 Hi All,

I modified the code as per suggession but still error

 #!/usr/local/bin/perl

 # Main program


 use warnings;
 use strict;
 use File::Find;

 my $file = "c:\\irfan\\cqcmd.txt";
 open (FH, $file) | die "file can't open $! \n";
 my ($line);

  while ($line = <FH>)
  {
   if ($line =~m/foo/)
   {
   print "match found";
   next;
   }
   else
   {
    print "match not found";
    }
   }
   close (FH);

error is


Useless use of bitwise or (|) in void context at C:\irfan\search.pl line

10.
file can't open Bad file descriptor


Regards
Irfan Sayed





The information contained in this electronic message and any attachments 
to this message are intended for the exclusive use of the addressee(s) and 
may contain proprietary, confidential or privileged information. If you 
are not the intended recipient, you should not disseminate, distribute or 
copy this e-mail. Please notify the sender immediately and destroy all 
copies of this message and any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient 
should check this email and any attachments for the presence of viruses. 
The company accepts no liability for any damage caused by any virus 
transmitted by this email.


www.wipro.com

Reply via email to