home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!dhami
- From: dhami@cs.ubc.ca (Mandeep S Dhami)
- Subject: A comparison (was simple question?)
- Message-ID: <1992Aug27.035605.9848@cs.ubc.ca>
- Sender: usenet@cs.ubc.ca (Usenet News)
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Date: Thu, 27 Aug 92 03:56:05 GMT
- Lines: 16
-
- Purely out of curiosity:
-
- $x="ffefab30";
- $y=join(".",grep($_=hex,unpack("a2a2a2a2",$x)));
- $y=join(".", unpack("C4", pack("N", hex($x)))); <-- 17% faster (of 1000 iter.)
-
- # After all it has 4 fn. calls compared to 7 in 1st (though hex is
- # quicker than others).
-
- Mandeep.
-
- --
- __________________________________________________________________
- "I'm very brave generally," he went on in a low voice:
- "only to-day I happen to have a headache."
- -- Lewis Carroll
-