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

Re: Puzzling $| behavior

by ikegami (Pope)
on Oct 07, 2007 at 23:16 UTC ( #643338=note: print w/ replies, xml ) Need Help??

in reply to Puzzling $| behavior

For starters, $|-- is special and may confuse the issue. $|-- toggles $| between 0 and 1. (No idea why)

Secondly, it's bad to modify and use a variable in the same expression because

print "first=", $var, " second=", $var--, "\n";

is basically equivalent to

do { local @_; alias $_[0] = "first="; alias $_[1] = $var; alias $_[2] = " second="; my $anon = $var--; # <-- Changes $var *and* $_[1] alias $_[3] = $anon; # since $_[1] is an alias alias $_[4] = "\n"; # for $var. &print; };

Comment on Re: Puzzling $| behavior
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2016-02-13 22:11 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (448 votes), past polls