Re: sprintf or pack
- From: Mirco Wahab <wahab-mail@xxxxxx>
- Date: Tue, 30 Jan 2007 15:00:45 +0100
Paul Lalli wrote:
On Jan 30, 7:33 am, "sonet" <sonet....@xxxxxxxxxxxxx> wrote:How to use pack or sprintf do the same thing?
$b='A';
$a=ord($b);
print int($a/16) . ($a % 16) ;
printf "%x", $a;
other TIMTOWTDIs
print unpack "H*", 'A';
or (non portable)
print unpack("H", 'A')
.unpack("h", 'A');
or
print +(ord('A')>>4)
.(ord('A')&15);
etc.
M.
.
- References:
- sprintf or pack
- From: sonet
- Re: sprintf or pack
- From: Paul Lalli
- sprintf or pack
- Prev by Date: Re: system() commands
- Next by Date: FAQ 2.7 Is there an ISO or ANSI certified version of Perl?
- Previous by thread: Re: sprintf or pack
- Next by thread: Parse::Eyapp a LALR yapp compatible Parser Generator
- Index(es):