Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Trying to load other perl scripts use() or require()

by gav^ (Curate)
on Jul 21, 2002 at 04:59 UTC ( [id://183777]=note: print w/replies, xml ) Need Help??


in reply to Trying to load other perl scripts use() or require()

Make sure your module returns a true value. The last line should be something like: 1;

gav^

Replies are listed 'Best First'.
Re: Re: Trying to load other perl scripts use() or require()
by dpuu (Chaplain) on Jul 21, 2002 at 05:16 UTC
    The value of any block in Perl is the result of the last statement in that block. If a block is a subroutine, then the result of the subroutine is the result of the block. You can use a "return" statement to exit the sub before the end; and at the end of the sub to be explicit about your intent. Modules are blocks. (Strangely, this doesn't apply to scripts: you have to use exit($value) to return a value from a script.) --Dave.
Re: Re: Trying to load other perl scripts use() or require()
by Anonymous Monk on Jul 21, 2002 at 05:11 UTC
    ty I dont remeber reading this in my book. so 1 is just like return(1);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-25 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found