in reply to Re: Way of the Spinner (repost)
in thread Way of the Spinner (repost)
use Attribute::Handlers; use Tie::Cycle; sub UNIVERSAL::Spinner : ATTR(SCALAR) { tie ${$_[2]}, 'Tie::Cycle', [map $_."\b" x length, @{$_[4]||[qw(\ | / -)]}] }
And then whip up custom spinners very elegantly, as the need arises:
$|=1; my $spinner : Spinner; print $spinner for (1..10000); my $morse_blinker : Spinner( qw(! : .) ); print $morse_blinker for (1..10000); my $wobbler : Spinner( "\)", "\(" ); print $wobbler for (1..10000); my $flexer : Spinner( '< ', ' >' ); print $flexer for (1..10000);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Way of the Spinner (repost)
by !unlike (Beadle) on Jan 23, 2003 at 09:08 UTC | |
|
Re: Re: Re: Way of the Spinner (repost)
by demerphq (Chancellor) on Jan 20, 2003 at 16:08 UTC |