Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: Avoiding silly programming mistakes

by Limbic~Region (Chancellor)
on Aug 20, 2008 at 14:48 UTC ( #705527=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Avoiding silly programming mistakes
in thread Avoiding silly programming mistakes

JavaFan,
I really don't mean to sound flippant but did you even read my node?

I was showing that perl doesn't issue a warning any time it sees an assignment in a conditional - only when it makes sense. This was intended for others reading along, not for you since you obviously know what you are talking about.

This is actually a common idiom, so it would be wrong for Perl to warn. Note that swapping the arguments around won't help you either: ... may be valid (if foo() returns an lvalue).

Yep, exactly what I said. Perl assumes you know what you are doing and when flipping operands, an error would happen unless there was an lvalue at play.

Cheers - L~R


Comment on Re^5: Avoiding silly programming mistakes

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-07-04 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls