Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: interpreting a server's response

by RichardK (Parson)
on Jan 13, 2012 at 13:54 UTC ( [id://947738]=note: print w/replies, xml ) Need Help??


in reply to interpreting a server's response

You could print your list using join

print join( ',', @list),"\n";

Or use Data::Dumper

Replies are listed 'Best First'.
Re^2: interpreting a server's response
by Aldebaran (Curate) on Jan 14, 2012 at 05:27 UTC

    Net::FTP=GLOB(0x86b28d0)<<< 226 Transfer complete drwx---r-t 6 u63263303 ftpusers 4096 Jan 13 22:04 .,drwx---r-t 6 u63263303 ftpusers 4096 Jan 13 22:04 ..,-rw-r--r-- 1 u63263303 ftpusers 688 Nov 8 20:37 agd1.html,-rw-r--r-- 1 u63263303 ftpusers 341 Jan 10 04:20 index.html,drwxr-xr-x 3 u63263303 root 4096 Jan 13 01:40 logs,-rw-r--r-- 1 u63263303 ftpusers 343 Jan 10 03:26 page1.html,-rw-r--r-- 1 u63263303 ftpusers 251 Jan 11 22:43 page2.html,-rw-r--r-- 1 u63263303 ftpusers 444 Jan 12 00:04 page3.html,-rw-r--r-- 1 u63263303 ftpusers 253 Jan 12 16:43 page4.html,-rw-r--r-- 1 u63263303 ftpusers 277 Jan 13 23:18 page5.html,drwxr-xr-x 2 u63263303 ftpusers 146 Jan 12 23:43 vids,drwxr-xr-x 5 u63263303 ftpusers 4096 Nov 12 19:22 wsb6326330301,drwxr-xr-x 2 u63263303 ftpusers 61 Jun 9 2011 zen

    $ cat upload4.pl #!/usr/bin/perl -w use strict; use Net::FTP; my $domain = 'www.altgreendsigns.com'; my $username = ''; my $password = ''; my $file1 = 'page5.html'; my $ftp = Net::FTP->new($domain, Debug=>1, Passive=>1) or die "Can' +t connect: $@\n"; $ftp->login($username, $password) or die "Couldn't login\n"; $ftp->put($file1) or die "put failed $@\n"; my @list = $ftp->dir(); print join( ',', @list),"\n"; $

    I'm the first to admit that I'll miss things, but I don't see how either Data::Dumper, with considerable wasted effort, applies. Furthermore I don't see how you might think this ouytput better.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://947738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-16 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found