The scripts are called from cron.
I could modify all the scripts writing one more perl script, that's not a problem. But scripts once modified, it's the testing that takes lots of time.
I need to execute a sub-routine from a module everytime I run a perl script. This sub-routine sets the library path depending on the base path of the script.
Easier way would be modify the script and add code to execute this sub-routine. But we have hundreds of scripts to edit which we are not...
I have the following XML file in the below format:
<root>
<clients id="4">
<name>temp</name>
<order>yes</order>
</clients>
</root>
I am using XML::Parser Tree Style and the Dumper gives me:
$VAR1 = [
'root',
[
{},
0...
What is the general purpose that I can use keys and values in the blessed hash for? Are these used only for initialization variables that the script gives to constructor? If all private values and references are assigned to 'my' variables in the class, where does one need to use these blessed...
I have the following class:
package MyClass;
sub new {
my $classname = shift;
bless {'a'=>1,'b'=>2}, $classname;
}
1;
And I am accessing the class in my script as below:
#!/usr/bin/perl -w
use MyClass;
my $objref = MyClass->new();
print ref($objref) . "\n";
print for...
I think 'use' would not work because it requires and imports the modules at compile time. Symbolic references would do at run time, so is the error.
I tried with 'require' and it didnt work. Though require would not import modules at compile time, it might be because 'require' checks the...
It's because only package variables are visible to symbolic references (that's what we are using here). Lexical variables (declared with my()) aren't in a symbol table, and thus are invisible to this mechanism.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.