Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!decwrl!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: problem (at least for me) with pack() Keywords: pack Message-ID: <9001@jpl-devvax.JPL.NASA.GOV> Date: 3 Aug 90 22:19:32 GMT References: Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: comp Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 26 In article knodel@fido.Colorado.EDU writes: : We have perl running here on a DECstation 3100 (Ultrix 3.1). : My problem with pack() is illustrated below: : : $word="abcdefgh"; : : print pack("A8",$word); : # gives "abcdefgh" : : print pack("A7",$word); : # gives "abcdef" : : print pack("A6",$word); : # gives "abcd" : : If the repeat count is more than the length of the string given to it, : it works and pads with spaces as expected; if the repeat count is less : than the string length, it seems to leave off twice as many characters : as it should form the end. : Is this a bug (with possibly an existing patch), or does it sound : like perl was somehow configured incorrectly for our system? Sounds more like the latter. What's your patchlevel? Does your perl pass the validation suite? Seems like the sort of thing an optimizer screws up. Larry