From: Roland G. <r.g...@xs...> - 2001-04-02 13:42:37
|
Dmitry Mottl wrote: > When I use Expect.pm to interact with program (mysqldump) which asks > for a password and dumps data to stdout, all lines are ended with "\r\n= ". > How can I change this behavior? I need lines ended with "\n" This behaviour could be changed by adjusting the terminal settings via exp_stty(), which takes a string with commands similar to =B4stty=B4. I'm no specialist for terminal settings, but "igncr" and/or=20 "-onlcr" could do what you want. OTOH, why do you need lines with "\n"? How about post-processing the output and removing the "\r" with =B4perl -e 's/\r+//g'=B4? If you have problems matching multiple lines, adjust your regexp by adding "\r*" before "\n". An even better way would be to use the Mysql perl module to directly=20 access the database without spawning an intermediate program. =20 Alternatively you could use the DBI module with its DBD::mysql driver=20 to keep the database exchangable. Hope this helps, Roland -- RGi...@cp... |