in reply to Lexical scope variable is not undef'ed

Thanks for very helpful replies. The bottom line is that an obvious shortcut (my $var = 'fff' if $predicate;) for proper:
my $var;
$var = 'fff' if $predicate;

Can be a tricky bug to track in say mod_perl environment, since it's behavior is not completely defined while no compiler warnings are produced...
  • Comment on Re: Lexical scope variable is not undef'ed

Replies are listed 'Best First'.
Re^2: Lexical scope variable is not undef'ed
by tilly (Archbishop) on Oct 23, 2007 at 00:34 UTC
    Ironically a warning was added at one point for this..then was removed because it triggered too many error messages.

    Grrr...