[comp.lang.perl] problem

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (08/04/90)

In article <knodel.649719716@fido> 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

phillips@cs.ubc.ca (George Phillips) (08/04/90)

In article <9001@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
:In article <knodel.649719716@fido> knodel@fido.Colorado.EDU writes:
:: My problem with pack() is illustrated below:
[ sample code deleted ]
:: 
::    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.
:

Actually, the former, but not any more.  It was fixed in patch #13 to 3.0.