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

Re^3: Perl Idioms Explained - $|++

by Aristotle (Chancellor)
on Aug 14, 2003 at 02:18 UTC ( #283747=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: Perl Idioms Explained - $|++
in thread Perl Idioms Explained - $|++

First, we don't need Yet-Another-Pair-Of-Constants-For-Zero-And-One.

I've come across cases where it helps readability. Specifically, when there are many cases where some arguments to the same function are actually interpreted as numbers and some others are booleans, then it can be much more maintainable to see something like $button->set_border(TRUE, 0, 2.5);, which clarifies that the 0 was meant as an actual numerical value of zero.

I've never had a case where I wanted any more named constants than for TRUE and FALSE, though.

Makeshifts last the longest.

Comment on Re^3: Perl Idioms Explained - $|++
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2015-11-28 19:55 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (744 votes), past polls