In Perl 5.10.1:
#!/usr/bin/perl my @a = (1, 2, 3); my $b = \@a; print join('', @{$b}) . "\n"; @a = (6, 7, 8); print join('', @{$b}) . "\n";
This prints 123, then 678. However, I would like to get 123 both times (i.e. reassigning the @a value @a not change the array that refers to $b ). How can i do this?
source share