Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: unpack and endianness Message-ID: <1990Oct8.152801.23049@uvaarpa.Virginia.EDU> Date: 8 Oct 90 15:28:01 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 16 X-Name: Cameron Simpson,foo Um, why can't I write sub swab { $_[0] =~ s/(.)(.)/$2$1/g; } Basically, because it doesn't work. This swaps every pair of bytes, but doesn't swap the byte pairs, etc. The goal is to turn ABCD into DCBA. Dale Worley Compass, Inc. worley@compass.com -- The great unsolved problem of feminsm is to decide whether we need to make men more like women, or women more like men.