use strict; use warnings; package Foo; our $bar; # "our" is like "my", but it # creates a package variable # instead of a lexical variable. sub init { $bar = 42; # "our" removes the need to # specify the package name. } ... 1;