Having written some general subs, I thought it useful to put them in a module myUtil.pm. It was structured as follows:
The module was put in the same library as the following main (rvBasic.pl)program:
The program aborted with the following messages
myUtil.pm did not return a true value at rvBasic.pl line 2
BEGIN failed compilation - aborted rvBasic.pl at line 2
After some trial and error, I modified the module as follows:
And everything worked smooth.
So, I should be happy. But I don't really understand why it works now. I read in the documentation the use is used at "compile" time, but obviously it does some execution as it asked for a true value?
Can somebody clarify this?
_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
Code:
use strict;
sub AAA {xxx;}
sub BBB {yyy;}
Code:
use qw(AAA);
$zz=&AAA($a1,$a2);
myUtil.pm did not return a true value at rvBasic.pl line 2
BEGIN failed compilation - aborted rvBasic.pl at line 2
After some trial and error, I modified the module as follows:
Code:
use strict;
return(1);
sub AAA {xxx;}
sub BBB {yyy;}
So, I should be happy. But I don't really understand why it works now. I read in the documentation the use is used at "compile" time, but obviously it does some execution as it asked for a true value?
Can somebody clarify this?
_________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]