in reply to converting tiny binary strings for internet transmission

Try any serializer. FreezeThaw, Storable. UUEncoding it is not such a bad idea
  • Comment on Re: converting tiny binary strings for internet transmission

Replies are listed 'Best First'.
Re: Answer: converting tiny binary strings for internet transmission
by zentara (Cardinal) on Mar 28, 2002 at 23:41 UTC
    Thanks for that pointer to serializers. I have done the following as a first attempt. Just send the hex. The one thing that gets me with this, is that when the last print occurs, it messes up my display, putting everything in binary. How do I prevent this? Anyone?
    #!/usr/bin/perl use strict; use warnings; open(FH,"<adminpass"); binmode FH; my $binstring= <FH>; print "$binstring\n"; my $hexstr= unpack "H*",$binstring; print "$hexstr\n"; my $binback= pack "H*",$hexstr; print "$binback\n";