Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!decwrl!ucbvax!hplabs!hpcc01!okamoto From: okamoto@hpcc01.HP.COM (Jeff Okamoto) Newsgroups: comp.lang.perl Subject: Re: Possible bug with shifting an array Message-ID: <12150006@hpcc01.HP.COM> Date: 16 Aug 90 16:47:52 GMT References: <12150004@hpcc01.HP.COM> Organization: Tendou Dojo Lines: 22 okamoto@hpcc01.HP.COM (That's me!) said: > I'm trying to unpack a structure that contains binary data. My > template is like this: $STRLEN = 20; $struct = "l i i a$STRLEN"; > After read'ing a number of bytes and unpacking, the variable that > corresponds to the "a" above doesn't get filled with nulls, it gets > filled with spaces, which I have verified using index. Using "A" > instead of "A" yields identical results. After further experimentation, it looks as though I may be using index incorrectly. This is what I am using now: $i = index($q_dest, '\000'); Perl -w doesn't complain, but $i always returns -1. What am I doing wrong here? Jeff