Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Convert to Hexadecimal

by davido (Cardinal)
on May 17, 2012 at 18:03 UTC ( [id://971137]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $string = "39860000N000";
    
    my $hexlen = sprintf( '%4.4x', length $string ) =~ s/ ( \p{Hex}{2} ) /
    +\\x$1/grx;
    
    print "Length of ($string) in hex: ($hexlen)\n";
    
  2. or download this
    my $string = '39860000N000';
    my $hexlen = sprintf '%4.4x', length $string;
    $hexlen =~ s/  ( \p{Hex}{2} ) /\\x$1/gx;
    print "Length of ($string) in hex: ($hexlen)\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-29 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found