Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^3: print a backspace in nph-"HTML"?

by VSarkiss (Monsignor)
on Dec 04, 2004 at 17:03 UTC ( #412421=note: print w/replies, xml ) Need Help??

in reply to Re^2: print a backspace in nph-"HTML"?
in thread print a backspace in nph-"HTML"?

It doesn't matter whether $count is zero -- that's the point I was making. The only use the OP's code is making of $count is whether or not to print the four backspaces. Basically, he wants $count to go:
     0, 1, 2, 3, (emit "\b\b\b\b"), 0, 1, 2, 3 , emit, 0, ...
And you've fallen into the same trap of caring what the values are.

All you care about is the sequence:
     loop, loop, loop, loop (emit "\b\b\b\b"), loop, loop, ...
Which is exactly what modulo arithmetic gains you.

You can adjust whether you want the backspaces emitted after the first, second, third, or fourth iteration by changing what value you want to look for (which is what I was trying to get at when I wrote "you should look for == 1 or == 3 depending on what effect you want to achieve.")

Replies are listed 'Best First'.
Re^4: print a backspace in nph-"HTML"?
by Zed_Lopez (Chaplain) on Dec 04, 2004 at 19:42 UTC

    You're right; I was only looking at the if clause in isolation, not in context.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2023-10-01 14:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found