in reply to Re^3: 2*pi*$r -- constant function without prototype
in thread 2*pi*$r -- constant function without prototype
I had the idea to use Data::Dumper with Deparse = 1 on the hash to look how perl optimizes the constants:
(I removed the use warnings; use strict 'refs'; from each sub to make it easier to read).$VAR1 = { 'direct' => sub { my $s = "abc\ndef\nghi"; }, 'scalarRW' => sub { my $s = "abc${Nl}def${Nl}ghi"; }, 'constant' => sub { my $s = "abc\ndef\nghi"; }, 'Readonly' => sub { my $s = "abc${NL}def${NL}ghi"; }, 'constant2' => sub { my $s = qq[abc${\"\n";}def${\"\n";}ghi] +; }, 'ScalarRO' => sub { my $s = "abc${nl}def${nl}ghi"; } };
|
---|