I am running a Linux box attempting to utilize Expect in my Perl script. I have been attempting to get it to run
several commands to no avail. I've read the documentation and I have no idea what the issue is. Anyway
here's the beginning of my code and the failure.
use Expect; $Expect::Debug = 1; my $string= '/usr/bin/ssh x.x.x.x' my $exp=Expect->spawn($string) || die "error $!\n"

I have tried many other commands than ssh with the same error. All the dependencies are also installed.
Below is the output I receive from the debug. If I don't run the debug I just get my prompt back. Any help greatly appreciated.
spawned '/usr/bin/ssh x.x.x.x' spawn id(3) Pid: 3399 Tty: /dev/pts/1 Expect::spawn('Expect', '/usr/bin/ssh x.x.x.x') called at test.pl line + 4 Closing spawn id(3). Expect::hard_close('Expect=GLOB(0x82ba93c)') called at /usr/lib/perl5/site_perl/5.8.4/Expect.pm line 1575 Expect::DESTROY('Expect=GLOB(0x82ba93c)') called at test.pl line 0 eval {...} called at test.pl line 0 spawn id(3) closed. Pid 3399 of spawn id(3) terminated, Status: 0x01

In reply to Expect Module problem by iloveperl

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.