Simpler examples of declaration inside of an expression:
open(my $fh, ...) [download]
( my $x = $y ) =~ s/.../.../; [download]
In reply to Re^5: use has it's own scope? by ikegami in thread use has it's own scope? by LanX