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

Reply via email to