Hi All, I have a situation where in I am calling the below Perl script

if (param("lremail") && param("lot")) { my $address=param("lremailaddress"); my $lot=param("lot"); print a({-href=>"$dir/new.pl"},"Back to Top"),br; print "Request submitted for $address.",br; print "Lot $lot",br; print "You will receive an e-mail with a link to the data when the + request is complete."; print end_html; system ("ssh SERVERNAME /test/abc.csh $lot $$ $address &"); exit(1);

The above script does not run because, when I execute the script its asking for a system password. Then I researched a little and wrote the below command..

expect -c 'spawn ssh SERVERNAME /test/abc.csh J213520 06 abc@gmail.com + "ls -lh file"; expect "Password:"; send "PASSWORD\r"; interact'

Now this command is executed successfully without any issue but from the command line only. When I incorporate the same(by replacing the system call) within the Perl script, it fails. How can I incorporate this line within the perl script?


In reply to How to incorporate Expect in Perl Script? OR Pass the password via perl script? by prad001

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.