Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Using Perl FTP to write a string variable as a file

by poj (Abbot)
on Dec 22, 2014 at 13:25 UTC ( [id://1111017]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Using Perl FTP to write a string variable as a file
in thread Using Perl FTP to write a string variable as a file

Try using a lexical filehandle

open( my $FH, "<", \$content ) or die "Kann File Handle nicht zum lesen aus content oeffnen"; . . $ftp->put( $FH, $remotefilename ) or die "put failed (Passive=$passive) ", $ftp->message, "; local +filename(FH): [$localfilename], remotefilename: [$remotefilename]"; $ftp->quit; close( $FH );
poj

Replies are listed 'Best First'.
Re^5: Using Perl FTP to write a string variable as a file
by toohoo (Beadle) on Dec 22, 2014 at 13:52 UTC

    Dear poj,

    many thanks, this works in my test script now. will try to move this to my live script.

    Thanks again and best regards, Thomas

    PS: I guess a :

    binmode( $FH );

    ... after open will be processed correctly

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found