Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: buffering question

by Rudif (Hermit)
on Aug 29, 2001 at 02:04 UTC ( [id://108619]=note: print w/replies, xml ) Need Help??


in reply to buffering question

it makes no difference unless someone sneaked in  $|=-1; while you were not looking ;-)

Rudif

Replies are listed 'Best First'.
Re: Re: buffering question
by I0 (Priest) on Aug 29, 2001 at 03:47 UTC
    $|=-1;is the same as $|=1; or ++$|;
      I think Rudif was pointing out that $|++ and $|=1 are interchangable, unless the value of $| is already -1. In that (rather rare) case, the two behave quite differently.

      -Blake

        It turns out that the value of $| can't be -1. This variable has special magic that only allows its value to be 0 or 1. Any true value assigned to $| becomes 1, and any false value becomes 0. So, $|++ and $|=1 really are interchangeable.

        Interestingly, $|-- and $|=0 are not interchangeable. If $| is 1, $|-- will of course set it to 0, but if $| is 0, $|-- will set it to 1!

        Similar magic can be found, for example, in the $. variable, which can only hold an integer.

Log In?
Username:
Password:

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

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

    No recent polls found