in reply to send ascii character in telnet.pm

It is conventional to describe control characters in uppercase, e.g. 'CTRL-D', also because the shift to the control character set is achieved by unsetting the seventh bit, e.g.:
print Control("G"); # ring my bell sub Control { return chr( ord( uc( shift() ) ) - 64 ); }

-M

Free your mind

Replies are listed 'Best First'.
Re^2: send ascii character in telnet.pm
by dsheroh (Monsignor) on Jun 20, 2006 at 15:30 UTC
    A simpler option is to use the \c token:
    print "\cG"; # ring bell print "\cD"; # send EOF marker