Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Why no warnings for 1 in void context?

by samtregar (Abbot)
on Jul 16, 2005 at 16:54 UTC ( #475480=note: print w/replies, xml ) Need Help??


in reply to Re: Why no warnings for 1 in void context?
in thread Why no warnings for 1 in void context?

The final line of a required module isn't in void context - it's the return value of the require. Try putting something else there and you'll see there's no warning. I worked with a guy who put (unfortunately copyrighted) poetry in a string at the end of his modules.

-sam

  • Comment on Re^2: Why no warnings for 1 in void context?

Replies are listed 'Best First'.
Re^3: Why no warnings for 1 in void context?
by nothingmuch (Priest) on Jul 17, 2005 at 07:53 UTC
    It is actually always in scalar context. I learned this while trying to be a wise ass with Devel::FIXME.

    -nuffin
    zz zZ Z Z #!perl
Re: Why no warnings for 1 in void context?
by jonadab (Parson) on Jul 17, 2005 at 11:26 UTC
    Yeah. I like to end modules with 42;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://475480]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2016-12-07 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.