thanx Corion,,,, i am not sure whether the following code is write
======================================
#file1 is in "d:/test.pm"
sub uvaraj
{
$name='ramu';
print 'uvaraj is a good boy in nature but...';
}
===================================
#file2 is in "d:/run.pl"
use lib 'D:/';
use test;
&uvaraj;
====================
i run the second file, it is giving error as "test.pm didnt return a true value" | [reply] [d/l] [select] |
You appear to be using the first file you mention ('d:/test.pm') as a module, and it is complaining that it did not return a true value. Modules must return a true value to let perl know they loaded correctly. Try appending the following as the last line of that file, and see if it makes a difference:
1;
In addition to the resources previously mentioned by Corion, et. al., you may also wish to look at the Tutorials section of this site (especially tachyon's Simple Module Tutorial), and in the documentation that comes with perl at perlfaq7 (question "How do I create a module?"), as well as perlmod, perlmodlib, perlmodstyle, and perlnewmod.
HTH. | [reply] [d/l] |