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

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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://5032]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-12-09 22:39 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (158 votes). Check out past polls.