in reply to serialise/unserialising data structures

Just as an observation, I was able to make it run with "use strict;" with the following addition:
#Encodes a hash/array ref to a bencoded string sub bEncode { my $dictref = $_[0]; my $retval = ''; #add this line my ($key, $value); if (ref($dictref) eq 'HASH') { ..... .....

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: serialise/unserialising data structures
by monoxide (Beadle) on May 31, 2005 at 06:49 UTC
    Hmmm... i use it with use strict; as it is there... or at least it is using strict in the file that do's the file that those functions are in, and it works fine. If you notice, that line is right after the if statement, $key is only use in the HASH ref section, $value is used in both the ARRAY and HASH ref section, and both are appropriatly myed, so i cannot see why you had troubles.
      Yes it's weird, I just downloaded the code again, and it worked fine, but I still have the original file which gave me errors. I include it here, just because I can't see where the difference is? Maybe a } got clipped somewhere? It has to be Monday. :-)

      I'm not really a human, but I play one on earth. flash japh