BEGIN { ... insert contents of CGI.pm here, stopping just before the __END__ token } BEGIN { CGI->import(":all"); } ... your code goes here ... my $foo = param("bar"); ... more of your code goes here ...