#!/usr/bin/perl

use Net::FTP;
use strict;


my $ftp = Net::FTP->new("localhost", Debug => 1, Port => 4559)
	  or die "Cannot connect to some.host.name: $@";

$ftp->login('aidan');

my $file = $ftp->put_temp("$ENV{HOME}/files/music.pdf");
print "FILE: $file\n";

$ftp->quot('JPARM', 'FROMUSER aidan');
$ftp->quot('JPARM', 'LASTTIME 000300');
$ftp->quot('JPARM', 'MAXDIALS 1');
$ftp->quot('JPARM', 'MAXTRIES 1');
$ftp->quot('JPARM', 'NOTIFYADDR faxmaster');
$ftp->quot('JPARM', 'VRES 98');
$ftp->quot('JPARM', 'PAGEWIDTH 215');
$ftp->quot('JPARM', 'PAGELENGTH 279');
$ftp->quot('JPARM', 'NOTIFY none');
$ftp->quot('JPARM', 'PAGECHOP default');
$ftp->quot('JPARM', 'CHOPTHRESHOLD 3');


$ftp->quot('JNEW');
$ftp->quot('JPARM', "DOCUMENT $file");
$ftp->quot('JPARM', 'DIALSTRING x8290');
$ftp->quot('JSUBM');

print "SUBMIT: " . $ftp->message() . "\n";

#$ftp->delete("/tmp/aidan-$$.pdf");
$ftp->quit;
