my $coderef; { my $x = 10; $coderef = sub { print "\nx is: $x\n"; }; }