Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Net::FTP behavior under Linux and Windows

by rbi (Monk)
on Oct 23, 2006 at 08:47 UTC ( #579961=perlquestion: print w/ replies, xml ) Need Help??
rbi has asked for the wisdom of the Perl Monks concerning the following question:

After I kindly got a solution to a Net::FTP problem I got, I could move to the next one :))
Considering this code:
... my $ftp = Net::FTP->new($hostname, Debug => 1, Passive => 1); $ftp->login($user,$password); $ftp->cwd($directory); my $ref= $ftp->ls(); die Dumper($ref);
If the $directory is empty, on Linux I get:
Can't use an undefined value as a symbol reference at /usr/lib/perl5/5 +.8.8/Net/FTP/dataconn.pm line 53.
Instead on Windows I get correctly:
$VAR1 = undef;
How could I fix this behaviour on Linux ? Thanks for any hint/explaination.

Comment on Net::FTP behavior under Linux and Windows
Select or Download Code
Re: Net::FTP behavior under Linux and Windows
by blazar (Canon) on Oct 23, 2006 at 12:07 UTC
    How could I fix this behaviour on Linux ? Thanks for any hint/explaination.

    First of all, are the versions of Perl respectively in Windows and in Linux the same? How 'bout the versions of Net::FTP and Data::Dumper?

    kirk:~ [14:06:30]$ perl -V:osname osname='linux'; kirk:~ [14:06:36]$ perl -MData::Dumper -e 'print Dumper undef' $VAR1 = undef;
      Perl version is v5.8.8 built for x86_64-linux-thread-multi and MSWin32-x86-multi-thread, respectively.
      Net::FTP is 2.75 on both PCs
      Data::Dumper is 2.121_08 on both PCs (but it behaves that way also not using Data::Dumper).<br/
Re: Net::FTP behavior under Linux and Windows
by Anonymous Monk on Oct 23, 2006 at 13:35 UTC
    What is your shebang?
      #!/usr/bin/perl

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://579961]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-08-01 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls