in reply to Re^3: Use of uninitialized value in addition
in thread Use of uninitialized value in addition

How is this "opaque"?

Information overload. Input, output, assignment and (negated) regex match all crammed where a simple condition is expected. And you don't even handle EOF cleanly!

Replies are listed 'Best First'.
Re^5: Use of uninitialized value in addition
by Marshall (Canon) on Mar 30, 2010 at 09:28 UTC
    Please post your code with a better way for us to see.
      He's referring to a quick "sketch" of code I had in a comment.
      for (;;) { print("Enter Number: "); defined( my $line = <STDIN> ) or last; s/^\s+//, s/\s+\z// for $line; next if $line eq ''; last if $line =~ /^(?:d|done)\z/i; ... }
      as a replacement for
      while ( (print "Enter Number: "), (my $line=<STDIN>) !~ /^\s*d(?:one)?\s*$/i ) { next if $line =~ /^\s*$/; #re-prompt on blank lines ... chomp($line); ... }