Sollenberger, Gandalf on Thu, 17 May 2001 16:38:07 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: why is the '1;' necessary at the end of perl modules


Title: RE: why is the '1;' necessary at the end of perl modules

For a piece of official documentation, page 205 of Programming Perl 2nd Ed. states "...the file must return true as the last value to indicate successful execution of any initialization code, so it's customary to end with a 1; unless you're sure it'll return true otherwise."


--G



----------
From:   Kyle R . Burton
Reply To:       phl@lists.pm.org
Sent:   Thursday, May 17, 2001 4:29 PM
To:     phl@lists.pm.org
Subject:        why is the '1;' necessary at the end of perl modules

I just had a co-worker ask me that question.  I was able to confirm that
it was needed and in fact show a few examples of where not having it (or
returning a false value) at the end of Perl modules caused them to halt
the execution of programs that 'required' them, but I am still unable to
find the (any) documentation that states clearly why it's necessary.

Is the reasoning behind this documented in one of the manpages?

Is it just that the true/false-ness of your module affects weather or
not it can be loaded via use/require? (and if it compiles of course)



I'd rather be able to point to some peice of official documentation,
instead of making my co-worker rely on my (often distorted) view of the
world.


Thanks,
Kyle R. Burton

--
------------------------------------------------------------------------------
   Of course power tools and alcohol don't mix.  Everyone knows power tools
   aren't soluble in alcohol...      -- Crazy Nigel
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**