home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!tcsi.com!iat.holonet.net!news.cerf.net!usc!howland.reston.ans.net!spool.mu.edu!olivea!sgigate!sgi!wdl1!wdl39!mab
- From: mab@wdl39.wdl.loral.com (Mark A Biggar)
- Newsgroups: comp.lang.perl
- Subject: Re: How to convert string to hex?
- Message-ID: <1993Jan27.002650.25531@wdl.loral.com>
- Date: 27 Jan 93 00:26:50 GMT
- References: <C1FnMG.AMB@ibeam.intel.com>
- Sender: news@wdl.loral.com
- Organization: Loral Western Development Labs
- Lines: 13
-
- In article <C1FnMG.AMB@ibeam.intel.com> gweil@ibeam.intel.com (Garry Weil) writes:
- >How do I convert "Test" to 0x54 0x65 0x73 0x74 ?
- >
- >Garry
-
- foreach $x (unpack("c*", "Test")) {
- $result .= sprintf("0x%02x ", $x);
- }
-
- --
- Perl's Maternal Uncle
- Mark Biggar
- mab@wdl1.wdl.loral.com
-