[perltidy] v0.9
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Fri, 29 Apr 2011 16:43:36 +0200
changeset 13 fcb7cefb7be7
parent 12 09f5c71b3a76
child 14 ed08617b4d8e
[perltidy]
ftpipe
--- a/ftpipe	Fri Apr 29 16:42:55 2011 +0200
+++ b/ftpipe	Fri Apr 29 16:43:36 2011 +0200
@@ -19,10 +19,11 @@
 
 MAIN: {
     GetOptions(
-        "p|put!" => sub { $opt_cmd = "put" },
-        "g|get!" => sub { $opt_cmd = "get" },
-        "l|ls!"  => sub { $opt_cmd = "ls" },
-        "d|L|ll|dir!"  => sub { $opt_cmd = "dir" },
+        "p|put!"      => sub { $opt_cmd = "put" },
+        "g|get!"      => sub { $opt_cmd = "get" },
+        "l|ls!"       => sub { $opt_cmd = "ls" },
+        "d|L|ll|dir!" => sub { $opt_cmd = "dir" },
+
         #"r|rm!"  =>
         "debug!" => \$opt_debug,
         "h|help" => sub { pod2usage(-verbose => 1, -exit => 0) },
@@ -35,8 +36,9 @@
 
     ### %ftp
     die "need hostname" if not defined $ftp{host};
-    die "need filename" if not defined $ftp{file}
-	and $opt_cmd ~~ [qw(put get)];
+    die "need filename"
+      if not defined $ftp{file}
+          and $opt_cmd ~~ [qw(put get)];
 
     my $ftp = new FTP($ftp{host}, Debug => $opt_debug, Passive => 1);
     $ftp->login($ftp{user}, $ftp{pass});
@@ -46,9 +48,9 @@
     given ($opt_cmd) {
         when ("put") { $ftp->put(*STDIN, $ftp{file}) }
         when ("get") { $ftp->get($ftp{file}, *STDOUT) }
-	when ("ls")  { say join "\n", sort $ftp->ls };
-	when ("dir") { say join "\n", sort $ftp->dir };
-        default { pod2usage };
+        when ("ls")  { say join "\n", sort $ftp->ls };
+        when ("dir") { say join "\n", sort $ftp->dir };
+        default      { pod2usage };
     }
 
     exit;