package Foo; my $hello; sub hello { print "$hello\n"; return; # I like explicit returns. } #### use strict; use warnings; use Foo; $Foo::hello = 'hello'; Foo::hello(); #prints "hello\n"