in reply to Re: More on hex pack/unpack
in thread More on hex pack/unpack

I have come to the source of my problem... STAY AWAY FROM ACTIVESTATE! I have 5.005_03 installed on both of my test machines, one running linux the other running NT 4.0. Guess what?

The unpack code only truncates under the NT 4.0 machine. Same image source, same everything. #*$%^@ ActiveState distro! I'm going to install DynamicPerl now! Thanks for the helping hand, httptech!

Code for unpacking (thanks mdillon) here:
#!/usr/bin/perl open IMG, "foo.gif" or die "Couldn't open image: $!\n"; undef $/; $image = <IMG>; $hex = unpack("H*", $image); close IMG; while ($txt = substr($hex,0,32,'')) { print "'$txt'\n"; }


#!/home/bbq/bin/perl
# Trust no1!

Replies are listed 'Best First'.
RE: RE: Re: More on hex pack/unpack
by Ozymandias (Hermit) on Jun 26, 2000 at 21:10 UTC
    It's too late to help you, but I just got an advisory warning that the latest versions of ActiveState Perl are seriously broken.

    So, yeah, it looks like avoiding them for a while might be a very good thing.

    - Ozymandias

    Update: Here's the text; not an official advisory, but a warning from someone I know and trust:

    Activestate Perl 5.6 build 613. Stop! If you haven't downloaded this version of Perl for Windows. DON'T! The Perl Package Manager (PPM) section is fatally broken. If you don't need the ability to install or update modules I guess you can go ahead and download this. But otherwise. DON'T. Yes, they have a "Hotfix" that updates PPM to version 1.1.4. But it doesn't work. The PPM commands install, verify, update, search, and query do not work both before and after installing the "fix". What's worse is that Activestate has known of these problems for at least two months but is not saying a thing about it on their website (except for what is displayed on the bug tracking server). If I were them, I would immediately pull this distribution and wait until all of the problems were resolved rather than letting people blindly download this thinking it is a stable release. An extreme WTF experience.

    Since I got the warning, I've heard again from him that other things are broken; although he didn't mention pack or unpack, it wouldn't surprise me a bit if there's even more screwed up than he mentioned.

      Would you care to send me a copy? Most of my development machines at work run on NT Workstation with ActiveState. It would be nice to know what's going on in advance. (just checked ActiveState's site and came up with zero).

      Updated too:
      Ok, so it seems this applies to 5.6 only. I have found a few odd features in the past with activestate (this binmode unpack was a new one though). We are currently using build 522 (5.005_03), so the above doesn't really apply. Nevertheless, I'm going to give Dynamic Perl a shot. I'm dropping the "better the devil you know" philosofy for a new chance at getting something more stable.

      #!/home/bbq/bin/perl
      # Trust no1!
RE: RE: Re: More on hex pack/unpack
by mdillon (Priest) on Jun 26, 2000 at 20:39 UTC
    i've only used Perl under Windows a couple times, but i believe this can be fixed by calling binmode on IMG before anything reads from it.
      Damnit you guys are good... Yup, that works also. Then again, calling binmode on linux worked as well. SO I guess its just a matter of calling binmode whenever regardless of the platform.

      #!/home/bbq/bin/perl
      # Trust no1!