I have a doubt in perl , I need to get filename in command line arguments/switches/options and based on that i need to include/require/use that file in my script. So by using that getopt variable am able to get it done. However if i have used "use strict" in my script i could not get it. Please help on this
I tried as follows and its working
base.pm:
our $def_name = "me";
main.pl:
my $name = "mathlib.pm";
require $name;
print $def_name;
When i include the follwoing lines in the main.pl and base.pm,
use strict;
use warnings;
I am getting error,
Global symbol "$def_name" requires explicit package name .
Execution of main.pl aborted due to compilation errors.
base.pmandmathlib.pmto be different?mathlib.pmlook like?