1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/perl -w #create ftp info file open(file, ">upload.txt"); print file "open xxxx.dyndns.org"\n"; print file "benutzername\n"; print file "passwort\n"; print file "binary\n"; print file "prompt\n"; print file "cd /pfad/\n"; print file "mget $filename.tar.gz\n"; print file "quit\n"; close(file);
1
2
3
4
5
Backslash found where operator expected at ./ftp.pl line 12, near "quit\"
Unquoted string "n" may clash with future reserved word at ./ftp.pl line 12.
String found where operator expected at ./ftp.pl line 12, at end of line
(Missing semicolon on previous line?)
syntax error at ./ftp.pl line 5, near ""open xxxx.dyndns.org"\"
print file "open xxxx.dyndns.org"\n";
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/usr/bin/perl use strict; use warnings; my $output_file = 'upload.txt'; my $filename = 'irgendwas'; #create ftp info file open( my $outfh, '>', $output_file ) or die "open($output_file,w) failed: $!\n"; print $outfh <<"OUTPUT"; open xxxx.dyndns.org benutzername passwort binary prompt cd /pfad/ mget $filename.tar.gz quit OUTPUT close( $outfh) or die "close($outfh) failed: $!\n";;