# in the main my $pkg = shift; no strict 'refs'; eval "require $pkg"; if($@) { croak "Failed to load $pkg: $@\n"; } print foobar();