Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story:

I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage.

This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only accepts one character.
I have sniffed out the traffic and the interaction seems to be valid.
The only clue i think i found is the Telnet negotiation, which I discovered from the telnet debug code:

But when it is spawned by the webpage, there is a difference in this line of code Telnet debug code:
SENT IAC SB NAWS 0 0 (0) 0 0 (0)

The CGI script runs fine when launched from the shell, and shows this code:
SENT IAC SB NAWS 0 80 (80) 0 24 (24)

So...I have given up on everything else, all I can think is that the device, possibly poorly coded and non-compliant, is crapping out on the Web server environment with 0 0 for columns and lines.
If this is the issue, does anyone know a way to force Telnet into standard 80x24 mode, or ignore the negotiation?
This equipment is discontinued and cannot go back to manufacturer to fix their Telnet code.

Thanks
JD

(don't mind me...just talking to myself here...)
Fixed problem with finicky Telnet device.
Used Net::Telnet instead of Expect.
When webpage spawned CGI script, this time the Telnet session from Net::Telnet did not send back a NAWS packet to the server,(like Expect did) so the login proceeded normally.