in reply to Generate temporary file and FTP upload

see File::Temp

$temp can be either a filehandle or filename. Try

$ftp->put($temp->filename) || die $ftp->message;
poj

Replies are listed 'Best First'.
Re^2: Generate temporary file and FTP upload
by karlgoethebier (Abbot) on Jun 30, 2017 at 21:00 UTC
    "...can be either a filehandle or filename"

    D'oh! Yes.

    Perhaps non-OO is more intuitive?

    #!/usr/bin/env perl use strict; use warnings; use File::Temp qw(tempfile); use feature qw(say); say( ( tempfile() )[1] ); __END__

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re^2: Generate temporary file and FTP upload
by welleozean (Novice) on Jun 30, 2017 at 19:50 UTC

    Your solution works! Thank you ! However, I am not quite sure about the difference, the reason being that if I print "$temp" (just after creating the temporary file) I get the correct filename (with path)...