-----this output i need in a file------ Starting EXPECT pattern matching... at /usr/local/share/perl5/Expect.pm line 597 Expect::expect('Expect=GLOB(0x2b70d80)', undef, 'ARRAY(0x2b71218)') called at /products/backend/mopgenie/expect3.pl line 86 handle id(9): list of patterns: #1: -re `[\r\n]?[^\r\n]+[%#>$] $' handle id(9): Does `' match: pattern #1: -re `[\r\n]?[^\r\n]+[%#>$] $'? No. handle id(9): Does `\033]0;user@host:~\007\033[?1034h[user@host ~]$ ' match: pattern #1: -re `[\r\n]?[^\r\n]+[%#>$] $'? YES!! Before match string: `' Match string: `\033]0;user@host:~\007\033[?1034h[user@host ~]$ ' After match string: `' Matchlist: () Calling hook CODE(0x2b70cd8)... Sending 'ls1;date \r' to handle id(9) at /usr/local/share/perl5/Expect.pm line 1421 Expect::print('Expect=GLOB(0x2b70d80)', 'ls1;date \x{d}') called at /products/backend/mopgenie/expect3.pl line 84 main::__ANON__('Expect=GLOB(0x2b70d80)') called at /usr/local/share/perl5/Expect.pm line 825 Expect::_multi_expect(undef, undef, 'ARRAY(0x1f52480)') called at /usr/local/share/perl5/Expect.pm line 602 Expect::expect('Expect=GLOB(0x2b70d80)', undef, 'ARRAY(0x2b71218)') called at /products/backend/mopgenie/expect3.pl line 86 Starting EXPECT pattern matching... at /usr/local/share/perl5/Expect.pm line 597 Expect::expect('Expect=GLOB(0x2b70d80)', undef, 'ARRAY(0x2b72a40)') called at /products/backend/mopgenie/expect3.pl line 122 handle id(9): list of patterns: #1: -re `[\r\n]?[^\r\n]+[%#>$] $'