develooper Front page | perl.beginners | Postings from January 2004

error but code works

Thread Next
From:
Gary Stainburn
Date:
January 29, 2004 06:14
Subject:
error but code works
Message ID:
200401291407.01821.gary.stainburn@ringways.co.uk
Hi folks,

I've got the following code which works, but generates the error message 
following it.  I've tried varying the code to eliminate the error but I only 
manage to get either the working code with error or non-working code without 
error.

(Line 95 is the while line)

      print "checking file $fname...";
      open DAT,"<$fname" ||die "cannot open $fname: $!\n";
      my $found=0;
      while ((my $line=<DAT>) && (! $found)) {
	print "line=$line" if ($DEBUG > 0);
        $found=1 if $line=~/$localpart:/;
      }
      close DAT;

root@stan input]# tidy-mailq|gvim -
Value of <HANDLE> construct can be "0"; test with defined() at 
/root/bin/tidy-mailq line 95.
Vim: Reading from stdin...
[root@stan input]#
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About