Values & References4 / 18
Up next

Scalar reference

use strict;
use warnings;
use feature 'say';

my $n = 42;
# \ takes a reference to a variable
my $ref = \$n;
# $$ref reads through it
say $$ref;
# writing through the ref changes the original
$$ref = 99;
say $n;
What you're solving

\$ makes a ref, $$ derefs