Dear wise Monks,

I am trying to program a little call routine for scp. I've found Net::SCP::Expect . It seems Net::SCP is not mighty enough to handle my needs. First question, does someone have another package which might be more easy or better?

As we all know, we can send a SCP through a system call like

scp -2 -q -C -i identity_file -P port -oBatchMode=yes -oStrictHostKeyChecking=no $localfilename $login\@$server:$remotefilename

The request to me now is to give a routine with parameters which does the call "in perl".

I think I have understood some things right:

  1. -q is automatically set
  2. -C is set through the OTION compress, but how do I have to write it? is it: compress=>1 ?
  3. -2 is set by protocol, so if I want to request protocol 2 it is written that? protocol=>2
  4. my server is passed that way? host=>$server
  5. user=>$login

Two other things I am asking myself how to do. I have given the options:

How can I give them to the new method?

Thanks in advance and best regards, Thomas


In reply to using scp package and options by toohoo

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, details, 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, summary, 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.