Oh man I've gotten so used the the || setup I completely forgot about how it treats
the left side as scalar. Changed the script and it worked like a champ. This will
turn out to be a very useful script indeed. THANKS!
~Matt C.
--- Peter Scott <[EMAIL PROTECTED]> wrote:
> At 03:08 PM 5/11/01 -0700, Matt Cauthorn wrote:
> > my @results=$s->cmd(String=>$string,Prompt=>'/root\@.*/') || warn
> > $s->errmsg
> >,"\n";
> >
> > print "@results\n";
> > $s->close();
> > }
> >
> >Here's the thing: the @results array only gives me the return value of the
> >command,
> >which is 1! In a scalar context it is supposed to do this, but in list
> >it's supposed
> >to print the output of your command, one line at a time. Am I missing
> >something??
>
> Does this explain it for you?
>
> $ perl -le 'sub foo{return (1,2,3)}; my @a=foo()||die; print "@a"; @a =
> foo() or die; print "@a"'
> 3
> 1 2 3
>
> --
> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/