home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5695 < prev    next >
Encoding:
Text File  |  1992-09-02  |  996 b   |  31 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!ferkel.ucsb.edu!piggy!chupchup
  3. From: chupchup@ferkel.ucsb.edu (Robert Earl)
  4. Subject: Re: Very tiny bug in printf? (perl 4.034)
  5. Message-ID: <chupchup.715510823@piggy>
  6. Organization: (EVIL!)
  7. References: <1992Sep3.020523.22087@aie.nl>
  8. Date: Thu, 3 Sep 1992 09:00:23 GMT
  9. Lines: 20
  10.  
  11. hansk@aie.nl (Hans Kinwel) writes:
  12.  
  13. | I expected the following three lines to print out 08 two times.
  14.  
  15. | $val="8";
  16. | printf ("%02s\n", $val);
  17. | printf ("%02d\n", $val);
  18.  
  19. | It does, under perl 3.044. My perl 4.034 does not, however.
  20. | There the first zero gets replaced by a space.
  21.  
  22. Funny, it printed out "08" twice in my version too.  'Twas a bug,
  23. because the "%##s" function pads with ## spaces, not zeroes, of
  24. course.
  25.  
  26. -- 
  27. "If you've got a pig that likes jumping fences, | robert earl
  28. you have to make its fence a lot higher all at  | rearl@ucsd.edu
  29. once -- if you do it by increments, all you're  | rearl@piggy.ucsb.edu
  30. doing is training a jumping pig." -Henry Spencer|
  31.