Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

RE: A whirleygig for a progress indicator for scripts

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


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];


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2015-07-31 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls