On Mon, Feb 18, 2002 at 07:20:50AM -0500, zentara wrote:
> You are using nested while loops to iterate
> thru a file, this isn't necessary. Also you don't need to
> open a file just to loop thru it.

Yes, you do.  At some level, you have to open the file if you want to
read its contents.


> my $file  = 'c:/davidcode/perlbeast/*.secret';
> while (<$file>){
> print "$file: $.  :$_\n"  if  /$regexp/;
> }

This code doesn't actually work.  Did you test it?  Perl won't automatically
open a file using the file read operator like that.  The <> operator is the
only one that's special in that respect.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to