Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
how handle these kind of "InMemoryfile" to put this on a local drive

Well, just use a plain file instead!

or to a webserver via HTTP::DAV of (S)FTP ? The transfer programs allways want to have a filename instead a filehandle.

HTTP::DAV implements WebDAV, which is, as the name suggests, an extension to HTTP. HTTP does not know anything about files. So a sane DAV client should be able to upload arbitary data, not just files. And in fact, HTTP::DAV documents for the put method:

One can upload/put a string by passing a reference to a scalar in the -local parameter.

Of course, to access the scalar behind IO::Scalar, you need to pass a reference to a scalar to the constructor IO::Scalar->new(), see IO::Scalar. BTW: You would pass the same reference to HTTP::DAV's put() method.

Net::SFTP implements open, read, write, close. No need to mess with in-memory files, but of course, you could write the scalar used to store the in-memory file using Net::SFTP's write method.

Net::FTP accepts a file name or a file handle for put(), so you should be able to pass the IO::Scalar instance to put().

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^5: in memory files in 5.6.1 by afoken
in thread in memory files in 5.6.1 by mandog

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (2)
    As of 2018-07-19 00:02 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















      Results (398 votes). Check out past polls.

      Notices?