Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to UPDATE rather than append to STDOUT?

by particle (Vicar)
on Jun 18, 2002 at 12:05 UTC ( #175345=note: print w/ replies, xml ) Need Help??


in reply to How to UPDATE rather than append to STDOUT?

this wasn't mentioned, so i thought i'd add it: you can use $. (input record number) to track which record you've reading from a file.

perl -ne "print qq/\r$. lines processed/;select undef, undef, undef, 0 +.2" your_file_here
four argument select is used as a sub-second delay (sleep allows only integer seconds,) to emulate file processing.

~Particle *accelerates*


Comment on Re: How to UPDATE rather than append to STDOUT?
Select or Download Code
Re^2: How to UPDATE rather than append to STDOUT?
by Anonymous Monk on Oct 07, 2011 at 00:42 UTC
    You can call a system("clear") before each print statement.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2015-07-07 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls