-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
printf ("%*c"... possible problem #2786
Comments
From [email protected]Created by [email protected]I believe there is a problem in the way perl handles field widths in perl -e 'printf ("%2c-\n", " ");' should print out 2 spaces followed by a dash. ie. " -" more simply: perl -e 'printf ("%c-\n", " ");' does not print the space at all! This also fails with perl 5.6.0 built for i586-linux. Perl Info
|
From [Unknown Contact. See original ticket]On Oct 31, fulko@wecan.com said:
You're used to the C idiom of: printf("%2c-", ' '); where ' ' is not an actual space, but rather the number 32. The %c format
jeffp@friday [9:27am] ~ #190> perl -lwe 'printf "<%c>", " "' Why did Perl abbreviate 'printf' as 'prtf'? |
From @vanstynIn <10010310919.aa08664@wecan.com>, fulko@wecan.com writes: No, it should format chr(" ") in a two character field. Now chr(" ") is If you turn on warnings, you will be given a clue to this: You can also verify that the zero byte is printed by piping the output Hope this helps, Hugo |
From @JohnPeacockEven stranger is why his code prints "fine" under NT: D:\>perl -we "printf ("""-%2c-\n""", """ """);" D:\> John Peacock Jeff Pinyan wrote:
|
From [Unknown Contact. See original ticket]Behind-the-scenes mail between John Peacock and myself That leaves the somewhat odd difference in the opcode.h tables, |
From @jhiOn Tue, Oct 31, 2000 at 09:29:22AM -0500, Jeff Pinyan wrote:
Perl 5.6.0: $ perl -lwe 'printf "<%c>", " "' |
From @jhiOn Tue, Oct 31, 2000 at 10:53:59AM -0500, John P. Linderman wrote:
Which version of Perl on UNIX does this? As I noted at least 5.6.0 |
From [Unknown Contact. See original ticket]
This is perl, version 5.005_03 built for sgi6-irix The curse of having too many versions of Perl on too many hosts, |
Migrated from rt.perl.org#4556 (status was 'resolved')
Searchable as RT4556$
The text was updated successfully, but these errors were encountered: