Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Progress Bar in Perl script

by kcott (Archbishop)
on Mar 13, 2013 at 14:46 UTC ( [id://1023216]=note: print w/replies, xml ) Need Help??


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

Each of the sails is created by prepending a "\b" to the spinner character:

my @sails = map { "\b$_" } qw{- \ | /};

"\b" is a backspace character; so, when each sail is printed, it deletes the previous one. In the initial state, "Running:" is followed by two spaces (print q{Running:  };); the second space is overwritten by the first sail.

"\b", and other special characters, are listed in perlop: Quote and Quote-like Operators.

-- Ken

Replies are listed 'Best First'.
Re^4: Progress Bar in Perl script
by regexes (Hermit) on Mar 13, 2013 at 15:17 UTC
    D'oh! Thanks! I knew I was overlooking something...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-04-23 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found