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

Re^2: Progress Bar in Perl script

by slayedbylucifer (Scribe)
on Jul 08, 2012 at 10:41 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2019-10-18 14:10 GMT
Find Nodes?
    Voting Booth?