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 ( #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.


Comment on Re^2: Progress Bar in Perl script
Re^3: Progress Bar in Perl script
by aitap (Deacon) 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
Node Status?
node history
Node Type: note [id://980570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-12-25 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls