Help for this page

Select Code to Download


  1. or download this
    perl -E "$str = 'Hi World!'; $sub = \substr $str, 0, 2; $$sub = 'Hello
    +'; say $str; say ref $sub"
    Hello World!
    LVALUE
    
  2. or download this
    use feature 'say';
    use Data::Dump qw( pp );
    use Storable qw/ freeze thaw /;
    ...
      $a->[1] = \$a->[0];
      $a;
    }
    
  3. or download this
    my $struct = ["Hi perlmonks"];
    push @$struct, \substr($struct->[0], 0, 2);
    my $storable = thaw freeze $struct;
    ...
    Hello perlmonks
    Hi perlmonks
    Hi perlmonks