Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: problem with require lib file

by Spenser (Friar)
on Dec 12, 2001 at 08:38 UTC ( [id://131166]=note: print w/replies, xml ) Need Help??


in reply to Re: problem with require lib file
in thread problem with require lib file

I'm still pretty new to Perl myself, so I can't elaborate like some of the others.  However, I have noticed that when setting up a *.lib file, the last line containing text of the lib file must read simply as follows:

1;

I don't know why that simple arabic numeral one with a semi-colon is necessary, but it is.  Again, there are those that will probably follow my comment with an explanation.  Actually, I would be interested to hear their response to this element.

Replies are listed 'Best First'.
Re: Re: problem with require lib file
by bmccoy (Beadle) on Dec 12, 2001 at 09:50 UTC
    Library module files are supposed to return a true value. Having a one at the end accomplishes this. I don't recall the exact reason but I think it's because, underneath all of the fancy importing and namespace magic that 'use' does, there's a 'do FILE' deep down, and it returns the last value evaluated in a file, and you will always want that to be true.

    -- Brett

    Go not to the Elves for counsel, for they will say both no and yes

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-16 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found