home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / perl / 7057 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  1.3 KB

  1. Path: sparky!uunet!noc.near.net!bigboote.WPI.EDU!bigboote.wpi.edu!john
  2. From: john@sekrit.WPI.EDU (John Stoffel)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: How to output % symbol in perl
  5. Date: 19 Nov 92 08:25:26
  6. Organization: Worcester Polytechnic Institute
  7. Lines: 25
  8. Distribution: usa
  9. Message-ID: <JOHN.92Nov19082526@sekrit.WPI.EDU>
  10. References: <1992Nov19.004813.16052@leland.Stanford.EDU>
  11. NNTP-Posting-Host: sekrit.wpi.edu
  12. In-reply-to: donghao@leland.Stanford.EDU's message of 19 Nov 92 00:48:13 GMT
  13.  
  14. >>>>> On 19 Nov 92 00:48:13 GMT, donghao@leland.Stanford.EDU (dong hao zhang) said:
  15.  
  16. dong> Suppose we run a file like the following:
  17.  
  18. dong> #! /usr/pubsw/bin/perl
  19. dong> printf STDOUT "\% A Latex Picture. \n";
  20.  
  21. dong> The output of the above file is:
  22. dong> A Latex Picture. 
  23. dong> instead of the desired: % A Latex Picture.
  24.  
  25. Don't use printf unless you really need to.  Use the plain print
  26. instead.  And by using print, you don't have to specify STDOUT either.
  27. So
  28.  
  29.     print "% A LaTeX Picture. \n";
  30.  
  31. will work now.
  32.  
  33.                 John
  34. --
  35. Youth of today!  Join me in a mass rally for traditional mental attitudes!
  36. -------------------------------------------------------------------------------
  37. john@wpi.wpi.edu | Work Station Specialist | Worcester Polytechnic Institute
  38. John Stoffel     | 508-831-5512 (work)     | Worcester, MA  01609
  39.