#!/usr/bin/perl -w
use strict;
my $aref = [1, 2, 3];
my @a = @$aref; # this line
$a[1] = 99;
print \"aref = @$aref\\n\";
print \"a = @a\\n\";
<
our @array; local *array = $aref;
Pros: Built-in feature since 5.6.
Cons: Ugly. Uses a global variable, so the variable is seen by called subs.
use Data::Alias qw( alias );
alias my @array = @$aref;
Pros: Clean.
Cons: This module gets broken by just about every Perl release (though it gets fixed quickly if not before the actual release).
use feature qw( refaliasing );
no warnings qw( experimental::refaliasing );
\my @array = $aref;
Pros: Built-in feature.
Cons: Requires Perl 5.22+, and even then, the feature is experimental.