Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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 imbibing at the Monastery: (7)
As of 2015-11-26 10:54 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 (697 votes), past polls