It only happens when run as a cgi script.
When I run it from the command line, it works as expected and produces only:
Content-type: text/html
test1
test2
I've also tried getting rid of the 'use CGI' line... but that didn't make a difference.
As far as using the perl module mentioned above... Firstly, I didn't know one existed, so I might look into that. I'm also familiar with using expect, I just can't figure out its odd behavior in this case. (and there's always more than one way to do it... and I already did it this way and it works.)
I'm just really currious as to why it behaves this way, I can't figure out why it would do this.
When run as a CGI script... does anyone else get the same odd results?
Thanks,
--
Josh I.