use strict; use warnings; print_foo(); my $foo = "bar\n"; sub print_foo { print $foo; } print_foo();