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";