Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Getting the ascii number through perl's printf

by virtualsue (Vicar)
on Jan 10, 2007 at 04:45 UTC ( [id://593823]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    use strict;
    
    print ord('c'), "\n";
    
  2. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    printf "%d\n", '12c3';  # printf stops the format conversion at the fi
    +rst non-integer  
    printf "%d\n", 'c123';  # No characters converted, 0 is returned
    printf "%d\n", '0c123'; # Conversion stops after first character, 0 is
    + returned
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-20 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found