Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
P is for Practical
 
PerlMonks  

RE: A whirleygig for a progress indicator for scripts

by btrott (Parson)
on Mar 08, 2000 at 17:57 UTC ( [id://5032]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to A whirleygig for a progress indicator for scripts

Or, since you're just taking the chr value of each of those numbers, just use map:
my @whirley = map chr, qw/32 176 177 178 219 178 177 176/;
Then you don't have to bother with split and all that.

Also, the whirley function could use some work (particularly since it gives a warning):

sub whirley { $WHIRLEY_COUNT = 0 if ++$WHIRLEY_COUNT == @whirley; return $whirley[$WHIRLEY_COUNT]; }
The most important change here is the return line. You were taking an array slice:
return "@whirley[$WHIRLEY_COUNT]";
which isn't what you want to do; you just want a single element (and you don't need the quotes):
return $whirley[$WHIRLEY_COUNT];

Replies are listed 'Best First'.
RE: RE: A whirleygig for a progress indicator for scripts
by da w00t (Sexton) on Mar 22, 2000 at 16:43 UTC
    Never used map before, Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://5032]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.