On Fri, Jun 15, 2001 at 12:14:39PM -0700, Joshua Chamas wrote:
> Stephen Bardsley wrote:
> > 
> > my $wfname = 'a session based filename';
> > my $csv = Text::CSV->new();
> > my @fft = ();
> > my @line = ();
> > 
> > open(IN, "./fft <$wfname |") or die "could not open $wfname";
> > while (<IN>) {
> >   $csv->parse($_);
> >   @line = $csv->fields();
> >   push(@fft, $line[0]);
> > }
> > close(IN);
> > 
> 
> I don't know that while(<IN>) is a good idea,

It's a standard Perl construct and it works fine.

> I wonder what would happen if somehow a line
> was blank, would that be boolean 0 ?

Nope.  "Blank" lines contain a single \n, so they evaluate as true.
while (<FILEHANDLE>) is a pretty common perl construct.

>  Try 
> instead:  for(<IN>), or even
> 
>  my @lines = <IN>
>  for ( @lines ) {
> 
> -- Josh
> 
> _________________________________________________________________
> Joshua Chamas                           Chamas Enterprises Inc.
> NodeWorks <- Web Link Checking          Huntington Beach, CA  USA 
> http://www.nodeworks.com                1-714-625-4051
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
meow
_ivan

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

Reply via email to