Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: using pl/pm and require HELP !

by nofernandes (Beadle)
on Jul 17, 2003 at 12:11 UTC ( [id://275187]=note: print w/replies, xml ) Need Help??


in reply to using pl/pm and require HELP !

Hi..

At the end of your myperlscript.pl you must put "1;" in order to return a true value!!

Example:

#sum.pl sub sum{ my($a,$b)=@_; my $res=$a+$b; return $res; } 1;

Calling this file with require

require "sum.pl"; $num1=5; $num2=10; $result=&sub($num1,$num2); print "$result";

I hope this helps and that i had understand the correctaly the question!!

Nuno

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://275187]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-16 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found