Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^2: Poor Perl Idioms Explained (except not really)

by robin (Chaplain)
on Oct 26, 2005 at 17:00 UTC ( #503114=note: print w/replies, xml ) Need Help??

in reply to (jeffa) Re: Poor Perl Idioms Explained (except not really)
in thread Perl Idioms Explained - $|++

what if someday the default for $| is instead 1?
That's not the problem:
$ perl -le '$| = 1; $|++; print $|++' 1
The problem is that it might confuse someone who doesn't know about this particular piece of DWIMmery.

Update: removed unfunny joke

Replies are listed 'Best First'.
Re^3: Poor Perl Idioms Explained (except not really)
by QM (Parson) on Oct 26, 2005 at 17:28 UTC
    Even more obvious:
    $ perl -le '$| = 42; print $|;$|--;print $|' 1 0
    So $|++ always sets it to true, and $|-- toggles it. Useful to know, but not obvious, and not consistent. But then DWIMmery is not necessarily consistent.

    Quantum Mechanics: The dreams stuff is made of

Re^3: Poor Perl Idioms Explained (except not really)
by jeffa (Bishop) on Oct 26, 2005 at 17:35 UTC

    I can tell you didn't actually test this.

    Actually, i did test it. But you try telling contrary to a manager that won't listen to you. ;) Even if you show him such code. And no ... i don't work for him anymore. :)

    Anyways, the point was not what it is now, but what will it be if it changed sometime in the future.


    (the triplet paradiddle with high-hat)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://503114]
[Corion]: And I'm not aware of any other serverless SQL implementation that even reaches the capability of SQLite, not to mention surpasses it

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2018-03-22 12:25 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (274 votes). Check out past polls.