Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: printf x format ?

by Fletch (Bishop)
on Mar 02, 2022 at 05:51 UTC ( [id://11141745]=note: print w/replies, xml ) Need Help??


in reply to printf x format ?

The string "A" isn't a number so none of the number or character expecting formats will do what you're apparently expecting (when converted to a number the numeric value is zero). Pass a number if you want to format a number (chr and/or ord will probably be of interest).

$ perl -E '$x = ord(q{A});printf( join( qq{\t}, qw( %c %x %d ) ) . qq{ +\n}, ($x)x3 )' A 41 65

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-28 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found