jasal has asked for the wisdom of the Perl Monks concerning the following question:
I would need to get for example this:
COM7:
to look like this:
0x4F43
0x374D
0x003A
0x0000
To get this: 434F4D373A, which is sort of correct, but what would be most convinient way to arrange it to look like what I need, and print it to a file?$string = "COM7:"; $string =~ s/(.)/sprintf("%02X",ord($1))/seg; print "$string\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: String to hex
by thundergnat (Deacon) on Aug 09, 2012 at 14:50 UTC | |
|
Re: String to hex
by Anonymous Monk on Aug 09, 2012 at 13:34 UTC | |
by Anonymous Monk on Aug 09, 2012 at 13:35 UTC | |
|
Re: String to hex
by trizen (Hermit) on Aug 09, 2012 at 14:20 UTC | |
|
Re: String to hex
by johngg (Canon) on Aug 10, 2012 at 23:34 UTC | |
|
Re: String to hex
by influx (Beadle) on Aug 09, 2012 at 13:45 UTC | |
by Anonymous Monk on Aug 09, 2012 at 13:58 UTC | |
by influx (Beadle) on Aug 09, 2012 at 14:46 UTC |