in reply to Multiple packages in one module file

There are a couple ways to do this (suprise, suprise).

consider that your file is called 'ab.pm'

BEGIN { require ab; } $a::variable; &b::subroutine;

now, if both packages inherit from Exporter to export variables:

BEGIN { require ab; import a qw( $var sub ); import b qw( sub2 sub3); }

If you only have one inheriting from Exporter, name the file after it. assuming it's called 'a.pm' and package 'a' inherits from Exporter:

use a qw( $var2 &sub ); BEGIN { import b qw( $foo %bar ); }