package foo; BEGIN { use Exporter; our(@ISA, @EXPORT); # use vars has been depreciated @ISA = qw(Exporter); @EXPORT = qw(header); } sub header { use CGI; # using OO-syntax for CGI.pm allows you the greatest flexibility my $cgi = new CGI; return $cgi->header; } 1;