in reply to Using pack/unpack on a PNG file

Somehow in searching for info, I didn't come across Pack/Unpack Tutorial (aka How the System Stores Data) until now, and it's shining a huge light on the whole thing, so it seems I should be able to figure this out after all.

Replies are listed 'Best First'.
Re^2: Using pack/unpack on a PNG file
by AnomalousMonk (Archbishop) on May 26, 2015 at 03:18 UTC

    See also perlpacktut.

    Update: In general, pack/unpack are almost as much fun as regexes!


    Give a man a fish:  <%-(-(-(-<

Re^2: Using pack/unpack on a PNG file
by AnomalousMonk (Archbishop) on May 26, 2015 at 03:28 UTC

    Also consider:

    c:\@Work\Perl\monks\sierpinski>perl -wMstrict -le "my $s = 'some string -- could be any length'; ;; my $up = unpack 'a*', $s; $s eq $up or die 'A: not identity operation'; ;; my $p = pack 'a*', $up; $s eq $p or die 'B: not identity operation'; ;; print 'a-ok'; " a-ok


    Give a man a fish:  <%-(-(-(-<