Is it possible to push
to an array reference in Perl? Googling has suggested I deference the array first, but this doesn't really work. It pushes to the deferenced array, not the referenced array.
For example,
my @a = ();
my $a_ref = [@a];
push(@$a_ref,"hello");
print $a[0];
@a
will not be updated and this code will fail because the array is still empty
(I'm still learning Perl references, so this might be an incredibly simple question. Sorry if so)