Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

automate Net::SSH::Perl install via CPAN

by perlknight (Pilgrim)
on Nov 04, 2003 at 22:23 UTC ( [id://304556]=perlquestion: print w/replies, xml ) Need Help??

perlknight has asked for the wisdom of the Perl Monks concerning the following question:

All, I am able to install Net::SSH::Perl successfully, but I am wondering if there is a way to this non-interactively, like when it ask you which ssh version you want to include and what sort of encryption you want to include, and so on. Is there a way to configure what you want a head of time or Have it install all by default? Thanks.
  • Comment on automate Net::SSH::Perl install via CPAN

Replies are listed 'Best First'.
Re: automate Net::SSH::Perl install via CPAN
by Plankton (Vicar) on Nov 04, 2003 at 22:35 UTC
    Maybe expect is what you are looking for. Also I asked a like question a while back in this node.

    Plankton: 1% Evil, 99% Hot Gas.
      plankton, yeah I did a search for net ssh perl before posting, I only see ref to people having trouble installing and using it. I was hoping there may be an option in CPAN modules which have this functionality, but it looks like it doesn't when I read it. Expect may be a way to go about getting this done automatically, but I am looking for a generic solutions for all other modules which requires human intervention to proceed. Any idea brothers?
Re: automate Net::SSH::Perl install via CPAN
by iburrell (Chaplain) on Nov 05, 2003 at 18:22 UTC
    Choosing the default is easy. Set the PERL_MM_USE_DEFAULT environment variable or connect /dev/null to stdin. I have only done this when running 'perl Makefile.PL' manually but it should be possible to automate CPAN:
    perl -MCPAN -e 'install Net::SSH::Perl' < /dev /null

    It may be possible to create a file with the selections and pipe this to Makefile.PL. This relies on the prompts coming in the same order.

      I have not done that, But I was thinking of using this code snippet from README on CPAN,
      #!/usr/bin/perl use CPAN; for $mod (qw(MD5 Net::SSH::Perl)){ my $obj = CPAN::Shell->expand('Module',$mod); $obj->install; }
      But I was wondering if I could automate it by passing Makefile.PL the arguments like so
      $obj->makepl_arg = "arg1 arg2 arg3 ..."; $obj->install;
      Have any one try this? Thanks.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found