Help for this page

Select Code to Download


  1. or download this
      my $x = \" VERY VERY BIG STRING .....";
      my $len = length( $$x );
    
  2. 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;
    
  3. 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
    
  4. 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%        
    +   --