Thank you very much. Another veteran tells me another method. It looks like follow code:
my @array;
...
@array=$session->expect(...);
...
I put print @array after each call on the expect, and it works. It is strange because as far as I know, if under list context, the return value of the expect is not the content that output of the command line.