in reply to Re: Why no warnings for 1 in void context?
in thread Why no warnings for 1 in void context?
1 while ....
That makes sense. Thanks.
NB - the 1 in a require isn't evaluated in a void context...
It is if, as I wrote, you syntax-check I did not write about the normal situation in which a module is require-ed; I referred to the case when one syntax-checks the module's file with perl -wc, e.g.:
(Hey, I did say it was a tortured rationale!)% echo 1 > Foo.pm % perl -wc Foo.pm Foo.pm syntax OK % echo 2 > Foo.pm % perl -wc Foo.pm Useless use of a constant in void context at Foo.pm line 1. Foo.pm syntax OK
But yes, normally, when a module is require'd the 1 (or whatever) is not evaluated in a void context.
Update: I fixed the wording, in response to ikegami's reply. The question of whether doing a syntax check on a module with perl -wc somehow turns it into a script is too metaphysical even for me.
the lowliest monk
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Why no warnings for 1 in void context?
by ikegami (Patriarch) on Jul 16, 2005 at 16:36 UTC |
In Section
Seekers of Perl Wisdom