On Jan 2, Booher Timothy B 1stLt AFRL/MNAC said:

>Thanks so much - only one problem: when I try to use while (my $line =
><MYFILE>) { etc } I get a bunch of errors similar to this one:
>
>Use of uninitialized value at JustForTest.pl line 13, <MYFILE> chunk 5.
>
>Do you know what I am doing wrong?

The code given you has an error.  You read the line into $line, but the
regex is being tested on $_.  Either do:

  while (<MYFILE>) {
    next if /^\s*$/;
    # ...
  }

or

  while (my $line = <MYFILE>) {
    next if $line =~ /^\s*$/;
    # ...
  }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


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

Reply via email to