if (my $x = do {my $x = f(); $x and g($x)}) { print "cheerful: $x\n"; } [download]
In reply to Re^3: scope of my $x in if statements by ikegami in thread scope of my $x in if statements by perl5ever