Help for this page

Select Code to Download


  1. or download this
    my @array      = qw[ 1 2 3 ];
    my $array_ref  = \@array;      # Backslash makes a reference
    my @array_copy = @$array_ref;  # @ de-references array reference
    ...
    print $array[1];       # Should be '5'
    $array_copy[1]  = 6;   # Modifies @array_copy, not @array
    print $array[1];       # Still '5'