sub print_power_of_2 { my $x = shift; my $result = power_of_2(); print "$x^2 = $result\n"; my $power_of_2 = sub { return $x ** 2; }; }