#!/usr/bin/perl use strict; use Net::FTP; my $ftp = Net::FTP->new("ftp.nai.com") or die "cannot connect: $@\n"; $ftp->login("anonymous",'anon@') or die "Cannot login: ", $ftp->message; #print $ftp->ls or die "ls failed: ", $ftp->message; my $dataconn = $ftp->retr('legal.txt'); my $buffer; my $bytes_read = $dataconn->read($buffer, 200); print $buffer;