#!/usr/bin/perl # this crap is an asynchronous finger client. it's rather idiotic ;) use Coro; use Coro::Socket; use Coro::Event; use AnyEvent; my $quit = AnyEvent->condvar; # this gets started everytime a user enters a finger command sub finger { my $user = shift; my $host = shift; my $fh = new Coro::Socket PeerHost => $host, PeerPort => "finger" or die "$user\@$host: $!"; print $fh "$user\n"; print "$user\@$host: $_" while <$fh>; print "$user\@$host: done\n"; } # display the time or garble the display, YMMV. async { my $w = Coro::Event->timer (interval => 0.001, hard => 1); use Time::HiRes qw(time); while () { $w->next; print "\e7\e[C\e[C\e[C\e[C\e[C\e[C\e[C\e[C