Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: A whirleygig for a progress indicator for scripts

by btrott (Parson)
on Mar 08, 2000 at 22:57 UTC ( [id://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];

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://5032]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found