Idle Curiosity

Jon Knight jon at net.lut.ac.uk
Mon Mar 30 02:40:47 EST 1998


On Sun, 29 Mar 1998, Peter Murray wrote:
> Perl has seriously erroded my C skills.  
> [...]
> .not to mention the portability advantages of Perl.  For work or play, I
> use more Perl now than ever before.

You might want to check out Advanced Perl Programming by Sriram Srinivasan
(ORA, ISBN 1-56592-220-4) if you feel you need a dose of Perl in your C
applications.  It contains (amongst many other things) three chapters on
integrating Perl and C.  One chapter explains in simple terms how to
extend Perl using C, the next describes how (and why) to embed Perl in C
and then the next (and last!) chapter discusses the internals of Perl.
Also see the perlembed(1) man page that describes embedding Perl into C
programs in detail.

Tatty bye,

Jim'll

#!/usr/bin/perl -s
use IO::Socket;sub w{$f=shift;$a{$f}=1;($h,$p,$q)=split("/",$f);$s=
IO::Socket::INET->new(PeerAddr=>"$h:$p")||return;print $s "$q\r\n";while(<$s>)
{next if(/^%/);if(/^# SERVER-TO-ASK/){while(<$s>){$x=$1 if/Name: (.*)\r\n$/;$y
=$1 if/Port: (.*)\r\n$/;$f="$x/$y/$q";@j=(@j,$f)if(/^# END/&&!$a{$f});}}else{
print;}}close($s);}@j=shift;while(@j){w(pop(@j));}# whois++.pl host/port/query



More information about the Web4lib mailing list