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

Re^2: Progress Bar in Perl script

by slayedbylucifer (Scribe)
on Jul 08, 2012 at 10:41 UTC ( [id://980570]=note: print w/replies, xml ) Need Help??


in reply to Re: Progress Bar in Perl script
in thread Progress Bar in Perl script

Yes. that is correct. I just wanted to show something like a "spinning" cursor progress which will tell the user that script is doing its job. I do not want to show how much percentage is completed. This is meant for Linux console on a RHEL 6.2 box.

Thanks Athanasius for your time.

Replies are listed 'Best First'.
Re^3: Progress Bar in Perl script
by aitap (Curate) on Jul 08, 2012 at 10:57 UTC
    So you can use the Term::Spinner module. It can be easily done manually, too:
    $|=1; #autoflush sub spin { my @spinners = qw{/ - \ |}; my $index = $_[0]; print $spinners[$index]."\033[1D"; # man console_codes, ECMA-48 CSI se +quences, "CUB" return $index == 3 ? 0 : $index++; } my $j=0; for (something) { do_something; $j=&spin($j); }
    Sorry if my advice was wrong.
      No, Your advice was not wrong. I think I am looking for something similar. I will definitely try out your suggestion. Thanks for your time.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found