Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Style or Clarity?

by CountZero (Bishop)
on Jun 08, 2004 at 20:29 UTC ( [id://362536]=note: print w/replies, xml ) Need Help??


in reply to Style or Clarity?

Whatever works for you is OK, although maintainers of your code may later grumble.

I don't think that context matters for the evaluation of the empty list in your code as any results are thrown away anyhow.

One way of testing it is wrapping your code in a subroutine and making sure that this part gets executed. As you know the return value of a sub is (unless you use an explicit return) the value of the last code evaluated. Check the return value of the sub and you will know it. To be on the safe side, call your subroutine in a scalar context and a list context and see if it matters.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-20 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found