Net-Ident
view release on metacpan or search on metacpan
# actual ident lookup.
my ( $os, $error );
( $username, $os, $error ) = Net::Ident::lookup( $accept, 10 );
defined $username
or die "SLEEP: Couldn't perform ident lookup: $error\n";
print "# identd tells us we're $username\n";
print $accept "you are $username\n";
close $accept;
close $listen;
# if you think the above is an extremely silly way to do getpwuid($<),
# think again. Just for fun, let's compare the ID we got with getpwuid
# and co... sometimes it IS different (for privacy-enhanced identd)
if ( ( getpwuid($<) && $username ne getpwuid($<) )
&& ( getlogin() && $username ne getlogin() )
&& ( $ENV{USER} && $username ne $ENV{USER} ) ) {
print "# Hmm... that doesn't look like getpwuid(\$<) = \"", getpwuid($<) || "(undef)", "\"\n";
print "# nor like getlogin() = \"", getlogin() || "(undef)", "\"\n";
print "# nor like $ENV{USER} = \"", $ENV{USER} || "(undef)", "\"\n";
}
# let apache warm up some more, if necessary
sleep $startuptime - time if $startuptime > time;
# test apache itself
my $result = GET( $apache_addr, "/testapache.txt" );
defined $result and $result =~ /^Apache OK/
( run in 0.345 second using v1.01-cache-2.11-cpan-8d75d55dd25 )