Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: What the heck does $|++; do?

by PhilHibbs (Hermit)
on Apr 13, 2004 at 17:35 UTC ( [id://344807]=note: print w/replies, xml ) Need Help??


in reply to Re: What the heck does $|++; do?
in thread What the heck does $|++; do?

Idiomatic? Needlessly obfuscated, I'd say,
I would say both. Part of me dislikes the peculiar ++ behaviour, but in it's defence, it is idiomatic.

Come to think of it, this is another of those cargo cults, isn't it? People doing $|++ without thinking of the consequences, such as non-nestability. If you know that there will not be any nested $| accesses for the same handle, then it's ok.

A minor point, ++ is easier to type than =1 in this case, as you already have your finger on the shift key from the |, so it requires two less actions (release Shift, move finger across keyboard to 1).

Replies are listed 'Best First'.
Re: Re^2: What the heck does $|++; do?
by Chady (Priest) on Apr 13, 2004 at 19:16 UTC
    ...move finger across keyboard to 1

    It is already there, you pressed 4 for the $ with your other hand, so your pinky is right above 1 ;-)


    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/
      Ah, but you still have to let go of the Shift key, your left hand is still positioned low down on the keyboard from pressing the | key, and pressing two different keys is still slower than pressing the same key twice! Hah! >:->

      Of course, on a French keyboard, you don't press shift to get the $ but you have to shift to get the 1, so I'm not sure which would be "most efficient". This requires further dilligent study.

Log In?
Username:
Password:

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

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

    No recent polls found