It's not the literal which makes the difference but - as already suspected in the OP - the constant folding.
#!/usr/bin/perl -l sub gen_arr { my $inner =shift; print my $outer = \"foo$inner"; # still a literal but not constant a +nymore return $outer; } gen_arr gen_arr;
Use of uninitialized value $inner in concatenation (.) or string at /t +mp/tst2.pl line 6. SCALAR(0x912c760) SCALAR(0x912c9d0)
Cheers Rolf
In reply to Re^2: Avoiding reference of sub optimization
by LanX
in thread Avoiding reference of sub optimization
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |