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