#!/usr/bin/perl use strict; use warnings; my $foo = 123; sub foo {print 'foo'} package bar; print $main::foo; &main::foo;