kcarpenter@soleo.com has asked for the wisdom of the Perl Monks concerning the following question:
I would like to use a variable in a "use" clause.
I have one script that runs on multiple servers, each taking its own <servername>_data.pm file
Currently I have to copy the script and rename the file in the use clause for each server.
I would like to advoid this and do something like
my $variable = "<servername>_data";
use $variable;
Is there any way to do this ?
I have one script that runs on multiple servers, each taking its own <servername>_data.pm file
Currently I have to copy the script and rename the file in the use clause for each server.
I would like to advoid this and do something like
my $variable = "<servername>_data";
use $variable;
Is there any way to do this ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: dereferencing use module
by InfiniteSilence (Curate) on May 23, 2014 at 20:50 UTC | |
Re: dereferencing use module
by skx (Parson) on May 24, 2014 at 00:01 UTC | |
Re: dereferencing use module
by boftx (Deacon) on May 23, 2014 at 23:24 UTC | |
Re: dereferencing use module
by LanX (Saint) on May 23, 2014 at 21:37 UTC | |
Re: dereferencing use module
by taint (Chaplain) on May 23, 2014 at 22:22 UTC |
Back to
Seekers of Perl Wisdom