Definitely a better idea to fix the old code, but ... would something like this DWYW?
#!/usr/bin/perl -w use strict; BEGIN { local %INC = %INC; require PackageA; import PackageA if UNIVERSAL::can('PackageA', 'import'); } BEGIN { local %INC = %INC; require PackageB; import PackageB if UNIVERSAL::can('PackageB', 'import'); }
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
In reply to Re: Perl use and require enigma
by Sidhekin
in thread Perl use and require enigma
by devnul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |