Help for this page

Select Code to Download


  1. or download this
    $x = { a => 1 };   # a reference
    $y = $x;           # a copy of a reference points to the same thing
    ...
    $y->{b} = 3;       # adds a hash item $x->{b}
    $y = { c => 0 };   # breaks the connection between $x and $y
    $y->{c}++;         # no effect on $x