Net::Finger - a Perl implementation of a finger client.
use Net::Finger;
# You can put the response in a scalar...
$response = finger('corbeau@execpc.com');
unless ($response) {
warn "Finger problem: $Net::Finger::error";
}
# ...or an array.
@lines = finger('corbeau@execpc.com', 1);
Net::Finger is a simple, straightforward implementation of a finger client in Perl -- so simple, in fact, that writing this documentation is almost unnecessary.
This module has one automatically exported function, appropriately
entitled finger(). It takes two arguments:
finger() is context-sensitive. If it's used in a scalar context, it
will return the server's response in one large string. If it's used in
an array context, it will return the response as a list, line by
line. If an error of some sort occurs, it returns undef and puts a
string describing the error into the package global variable
$Net::Finger::error. If you'd like to see some excessively verbose
output describing every step finger() takes while talking to the
other server, put a true value in the variable $Net::Finger::debug.
Here's a sample program that implements a very tiny, stripped-down finger(1):
#!/usr/bin/perl -w
use Net::Finger;
use Getopt::Std;
use vars qw($opt_l);
getopts('l');
$x = finger($ARGV[0], $opt_l);
if ($x) {
print $x;
} else {
warn "$0: error: $Net::Finger::error\n";
}
Dennis Taylor, <corbeau@execpc.com>
perl(1), finger(1), RFC 1288.