Help for this page

Select Code to Download


  1. or download this
    $ perl -E 'sub foo { $_[0]= 5 } foo(4)'
    Modification of a read-only value attempted at -e line 1.
    
  2. or download this
    use Scalar::Util "readonly";
    sub foo {
    ...
    foo(4);
    foo(my $x= 4);
    print "$x\n";