in reply to Expect.pm Help with Automating SSH
my $spawn = expect->spawn("ssh $_")
You have a typo in the above which the docs say should be
my $spawn = Expect->spawn("ssh $_")
If you hadn't imported the expect sub then strict would have picked this up. ie:
$ cat et.pl #!/usr/bin/env perl use strict; use warnings; use Expect (); my $spawn = expect->spawn("foo $_"); $ perl et.pl Use of uninitialized value $_ in concatenation (.) or string at et.pl +line 6. Can't locate object method "spawn" via package "expect" (perhaps you f +orgot to load "expect"?) at et.pl line 6.
|
|---|