Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

barjaph

by mkmcconn (Chaplain)
on Feb 10, 2001 at 22:05 UTC ( #57637=snippet: print w/replies, xml ) Need Help??
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__
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: snippet [id://57637]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2023-06-04 23:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (22 votes). Check out past polls.

    Notices?