----------------------------------------------- test.pm ----------------------------------------------- package test; sub ReturnValue() { my $a=10; return ($a); } 1; # as a module usually has a return value ----------------------------------------------- call.pl ----------------------------------------------- use test; print test::ReturnValue(); # specify the package name where the function resides #or u could try this also $tmp=test; print $tmp->ReturnValue();
#----- jabir --- Abhishek Dave <[EMAIL PROTECTED]> wrote: > hello all, > i've wrote a small test subroutine in my file name > test.pm and in the same directory i worte > a perl file in which i've to call this subroutine in > this perl program > > I dont know how to use perl modules > pls let me knwo abt that as it will solve my lots of > problems > > test.pm > > sub ReturnValue() > { > my $a=10; > return ($a); > } > > call.pl > > use test; > print ReturnValue(); > > > --I don't know abt the moduls in perl > > Pls help me in this regard asap > > waiting for reply from perl group > > Thanks > Beginner I do the diffcult immediately,but the impossible take's a little longer!!! Cresent canaopy apartments #19 Davis Road, Thomas town, Bangalore -84 Phone (mobile) : +91-98867 01148 E-Mail: [EMAIL PROTECTED],[EMAIL PROTECTED] __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>