- or download this
my $x = \" VERY VERY BIG STRING .....";
my $len = length( $$x );
- or download this
my $string = 'Long string' x 100000;
sub psau() { print grep { /\b$$\b/ } `ps au` } # POSIX platforms
sub bar { psau }
...
foo($string);
mod($string);
psau;
- or download this
use Devel::Size qw< size total_size >;
sub size_print($\$) {
...
$collection (empty) 24 88
$collection ( one ) 24 1278
$collection ( two ) 24 1302
- or download this
use Benchmark qw<cmpthese>;
my $string = 'Long string' x 1000;
...
$$ref 18937129/s 9% -- -30%
+ -32%
$really_long 27185304/s 57% 44% --
+ -2%
$string 27870647/s 61% 47% 3%
+ --