home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 5032 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.4 KB  |  37 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!cs.utexas.edu!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: CHR$() in Perl
  5. Message-ID: <1992Jul30.000824.8976@news.eng.convex.com>
  6. Originator: tchrist@pixel.convex.com
  7. Sender: usenet@news.eng.convex.com (news access account)
  8. Nntp-Posting-Host: pixel.convex.com
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. Organization: CONVEX Realtime Development, Colorado Springs, CO
  11. References: <tswenson.712440785@de3a1066a.osd.mil>
  12. Date: Thu, 30 Jul 1992 00:08:24 GMT
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 19
  17.  
  18. From the keyboard of tswenson@de3a1066a.osd.mil (Tim Swenson):
  19. :This may be simple, but I've looked through
  20. :the Camel book and can't find a thing on this.
  21. :
  22. :I'm looking for the opposite of the ord function.
  23. :(The same as CHR$() in Basic).  Given a number I
  24. :need to print the ASCII value of that number.
  25. :In other works, if X=65 I want to print an A.
  26. :
  27. :I need to know how to do this in Perl.
  28.  
  29. Use sprintf with %c or pack with C.
  30.  
  31. --tom
  32. -- 
  33.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  34. And don't tell me there isn't one bit of difference between null and space,
  35. because that's exactly how much difference there is.  :-)
  36.         --Larry Wall in <10209@jpl-devvax.JPL.NASA.GOV>
  37.