home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!darwin.sura.net!paladin.american.edu!howland.reston.ans.net!usc!cs.utexas.edu!sun-barr!olivea!sgigate!sgiblab!adagio.panasonic.com!chorus.mei!sweet.mei!alps.msr.mei!alps!shiji
- From: shiji@msr.mei.co.jp
- Newsgroups: comp.lang.perl
- Subject: Re: How to convert string to hex?
- Message-ID: <SHIJI.93Jan27133115@alps.msr.mei.co.jp>
- Date: 27 Jan 93 04:31:15 GMT
- References: <C1FnMG.AMB@ibeam.intel.com>
- Sender: news@msr.mei.co.jp
- Organization: Matsushita Soft-Research,Inc.,Osaka, Japan
- Lines: 22
- In-Reply-To: gweil@ibeam.intel.com's message of 26 Jan 93 08:23:03 JST
- Nntp-Posting-Host: alps
-
- In article <C1FnMG.AMB@ibeam.intel.com> gweil@ibeam.intel.com (Garry Weil) writes:
-
- $@!U(JHow do I convert "Test" to 0x54 0x65 0x73 0x74 ?
-
- Something like as follows ?
-
- #! /usr/local/bin/perl
- while (<>) {
- chop;
- split(//);
- for $c (@_) {
- $c = sprintf("0x%02x", ord $c);
- }
- print "@_\n";
- }
-
-
- ---
- Toshiaki Shiji
- Software Development Department 5
- Matsushita Soft-Research, Inc. Email: shiji@msr.mei.co.jp
- ---------------------------------------------------------------------------
-