Hi all,

First post to the group. I have two questions, but they go hand in hand. The first:

Net::FTP documentation reports that get syntax is:

get ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] )

I do the following (with $ftp initialization omitted here):

local $fh = IO::File->new_tmpfile;
$ftp->get($dump_path, $fh);
print $fh; (or print <$fh>;)

When I run this, I get no errors, but I can not get the text into the temporary file. I have also tried:

open(FILE, "> anything.txt");
$ftp->get($dump_path, FILE);

Here, the file is created, but contains no text.

To show this works otheriwse, if I try:

$ftp->get($dump_path, "> anything.txt");

sure enough, It works great.

What am I doing wrong in the first example?

Second question:

The following is from the get() subroutine in the FTP Perl Module:

$localfd = ref($local) || ref(\$local) eq "GLOB"
            ? fileno($local)
            : undef;

($local = $remote) =~ s#^.*/##
       unless(defined $local);

where $local comes from:

my($ftp,$remote,$local,$where) = @_;

Could someone explain what this code is doing (several things happening here I havn't seen before, I was looking at this to see what was wrong with how I was using a filehandle.)

Thanks!
Steve



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to