Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!frankland-river!pem From: pem@frankland-river.aaii.oz.au (Paul E. Maisano) Newsgroups: comp.lang.perl Subject: more termcap.pl problems & a quick question Message-ID: <1171@frankland-river.aaii.oz.au> Date: 27 Feb 90 05:13:34 GMT Organization: Australian AI Institute Lines: 30 The subroutine Tgoto in termcap.pl does not seem to work. To fix it I placed "local(@args) = @_;" at the start and replaced @_ by @args throughout. This sounds vaguely familiar to me. It might already be fixed in patch 9. By the way, I might have missed something in the manual but is there some way to do the reverse of the "ord()" function. Ie. go from a number to a character. I know that unpack will do it. The reason I ask is, I needed a function to print out a readable string which might contain control characters. For example, given "\001x\002" it would print out "^Ax^B". What I came up with (rather quickly/hastily) was: sub p { local($str) = @_; $str =~ s/([\000-\037])/(($x)=unpack("c", $1),"^".pack("c", $x+0100))/eg; print $str; } This seems horribly inelegant. Suggestions anyone ? ------------------ Paul E. Maisano Australian Artificial Intelligence Institute 1 Grattan St. Carlton, Vic. 3053, Australia Ph: +613 663-7922 Fax: +613 663-7937 Email: pem@aaii.oz.au