Using strict, it gives me:
Bareword "DATA" not allowed while "strict subs" in use at ftp.pl line 12.
Execution of ftp.pl aborted due to compilation errors.
without strict, it gives me:
Cannot open Local file DATA: No such file or directory
at ftp.pl line 12
Line 12 is: $ftp->put(DATA ,'index.html');
Finally, skipping __DATA__ altogether and using IO::Scalar . . well nevermind . . that works wonderfully :)
#!/usr/bin/perl
use strict;
use warnings;
use IO::Scalar;
use Net::FTP;
my $ftp = Net::FTP->new("my.ftp.host", Debug => 0, Passive => 1);
my $data = "<html><head><title>Foo</title></head><body>Bar</body></htm
+l>";
my $SH = new IO::Scalar \$data;
$ftp->login("username",'mypass');
$ftp->cwd("newpage");
$ftp->rename('file.html','file.old');
$ftp->put($SH ,'file.html');
|