X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,cfbf3b9c9d2640a3 X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 2001-06-08 12:50:12 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!panix!news.panix.com!qz!not-for-mail From: Eli the Bearded <*@qz.little-neck.ny.us> Newsgroups: alt.ascii-art Subject: Re: archive Date: 8 Jun 2001 19:50:11 GMT Organization: Some absurd concept Lines: 85 Message-ID: References: <2001.158.80561.1428257@205.198.93.196> <992001111.3975@itz.pp.sci.fi> NNTP-Posting-Host: panix1.panix.com X-Trace: news.panix.com 992029811 29958 166.84.0.226 (8 Jun 2001 19:50:11 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: 8 Jun 2001 19:50:11 GMT X-Files: Used for sharpening claws and teeth on your hawk and hacksaw X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix X-US-Congress: Moronic Fucks. X-Attribution: EtB X-Usenet-II: Because it is time for October. Encrypted: double rot-13 X-Newsreader: Sony Playstation 5.0MIPS Xref: archiver1.google.com alt.ascii-art:6059 In alt.ascii-art, Ilmari Karonen wrote: > In article , Faux_Pseudo wrote: > >dose any one know of a way to do the above perl script without going > >and downloading the Time::HiRes mod? > perl -pe 'select undef,undef,undef, 0.02' FILE Of course, now that I've looked at more of them, I see by line delays don't work very well all the time. And the "microdelays" take a lot longer than they should, for very small delays which makes a per character delay too slow to bear. Here's a much better slowcat perl script (and it uses select, instead of Time::HiRes to be friendlier): #!/usr/bin/perl -wn # A slow version of 'cat' for playing ascii-art movies on # fast terminals. # # Eli the Bearded 7 Jun 2001 use strict; use vars qw( $part @parts $delay $default); BEGIN { my $usage; $default = 0.02; USAGE: if ($usage) { print STDERR <<"UsageEnd"; $0: usage slowcat [ -d delay ] [file ...] Delay is fractional seconds. Default delay is $default seconds. UsageEnd exit 2; } if (defined($ARGV[0])) { if ($ARGV[0] eq '-h' or $ARGV[0] eq '--help') { $usage = 1; goto USAGE; } elsif ($ARGV[0] eq '-d' or $ARGV[0] eq '--delay') { shift; $delay = shift; if (!defined($delay) or $delay !~ /^(?:\d*\.)?\d+$/) { warn "$0: Bad delay\n"; $usage = 1; goto USAGE; } } } $delay = $default unless $delay; $| ++; # Uncomment this to clear the screen at the start of the output. # system("tput clear"); } END { # Uncomment this to clear the screen at the end of the output. # system("tput clear"); } # Split on escape, since those typically begin cursor movements. @parts = split(/(?=\c[)/); for $part (@parts) { # If it is still very large, split up into line size chunks if (length($part) > 80) { while(length($part)) { select(undef,undef,undef, $delay); print substr($part,0,80,''); } } else { select(undef,undef,undef, $delay); print $part; } } __END__ Elijah ------ wanted to see the spider spin the web, properly