Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Sometimes it's in Void Context

by chromatic (Archbishop)
on Jun 01, 2002 at 02:22 UTC ( [id://170872]=note: print w/replies, xml ) Need Help??


in reply to Sometimes it's in Void Context

Try it with 'diamond' or 'iguana' and it will also be silent!

I was half right. The warning comes from op.c, specifically Perl_scalarvoid. When it hits a constant op, it checks to see if it should throw a bareword warning. Otherwise, if it needs to warn about useless constants in void context, it does. There's a hack, though, like I thought, but the comment says:

/* the constants 0 and 1 are permitted as they are conventionally used as dummies in constructs like 1 while some_condition_with_side_effects; */

Log In?
Username:
Password:

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

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

    No recent polls found