- or download this
#./ThisPackage.pm
package ThisPackage;
...
print "Dummy code gets run at compile/use time\n";
1;
- or download this
#./pkg.pl
BEGIN { print "this should print before\n" }
...
use ThisPackage;
ThisPackage::new(qw/hello world/);
BEGIN { print "this should print after the use, but before the new\n"
+}
- or download this
# output
this should print before
Dummy code gets run at compile/use time
this should print after the use, but before the new
ThisPackage::new(hello world)