Description: |
A progress bar in the form of a JAPH.
Not tested on Windows.
Reminder: ;-) print "TRUE" if "JAPH" ne "OBFUSCATION";
|
#!/usr/bin/perl -w
use strict;
$|++;
spell() or print "\n";
sub spaz{
# you can increase the repetitions to slow this down
# or add something useful in the loop
for (1..600) {
print "$_\x08" for ("|","/","-","\\","_");
}
}
sub spell {
print and spaz for split // , qq._just another perl hacker.;
}
__END__
# cutesified, for a signature.
sub spaz{for(1..600){print"$_\x08"for("|","/",
"-","\\","_");}}for (qq.just another perl hacker!.){
for(split //){print if s i ! i \n ix or print and spaz ;} }
__END__
#!/usr/bin/perl -wT
# Same idea, but cleaned up of the
# JAPH silliness.
# Now it will measure progress (spaz() is
# wasteful for real work. This will give
# you an idea, though.) "./*" is used :. -T is too.
use strict;
work();
sub spaz{
for (1..600) {
print "$_\x08" for ("|","/","-","\\");
}
}
sub work {
for (glob "./*"){
open FILE, $_ or die "$_: $!";
print "|";
# do something...
close FILE;
spaz;
}
print " Done!\n";
}
__END__
|