#!/usr/bin/perl -w use strict; sub make_spinner{ my $s = shift; my $i = 0; my $l = length $s; return sub{ unpack("x".($i++ % $l) . "A1", $s) . "\cH"; } } my $spinner = make_spinner '-\|/'; $|++; print "Working "; print $spinner->() for 1 .. 10000; print "\n";
Makeshifts last the longest.
In reply to Re^2: Way of the Spinner (repost)
by Aristotle
in thread Way of the Spinner (repost)
by !unlike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |