#!/usr/bin/env perl use strict; use warnings; use feature 'say'; my $a = "original"; my $a_ref1 = \$a; my $a_ref2 = \$a; my $a_copy = $a; say "\$a is $a"; say "\$a_ref1 is $$a_ref1"; say "\$a_ref2 is $$a_ref2"; say "\$a_copy is $a_copy"; say "OK, let's alter only the first reference (\$a_ref1):"; $$a_ref1 = "altered"; say "\$a is $a"; say "\$a_ref1 is $$a_ref1"; say "\$a_ref2 is $$a_ref2"; say "\$a_copy is $a_copy";