No description, website, or topics provided.
Other Shell
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
lib
t Add support for whitespace in the template Feb 22, 2016
.gitignore
LICENSE Make it something distributable with the ecosystem Feb 22, 2016
META6.json Use SPDX identifier in license field of META6.json Apr 21, 2017
README.md Make code blocks stand out as code May 13, 2017
prove6

README.md

PackUnpack

An attempt at implementing Perl 5's pack/unpack functionality efficiently in Perl 6, if for no other reason we're going to need it to support "use v5".

Description

Exports 3 subroutines:

  • pack
  • unpack
  • parse-pack-template

pack

Provide functionality of Perl 5's pack statement. Currently supported directives are: a A c C h H i I l L n N q Q s S U v V x Z

unpack

Provide functionality of Perl 5's pack statement. Currently supported directives are: a A c C h H i I l L n N q Q s S U v V x Z

parse-pack-template

Parses a given template into an internal format. If many calls are made to pack/unpack with the same template, efficiency will improve by parsing the template only once and feeding its result to pack/unpack instead of the original template string.

use PackUnpack;

say pack("ccxxcc",65,66,67,68); # "AB\0\0CD";

my @template = parse-pack-template("ccxxcc"); say pack(@template,65,66,67,68); # same

Copying

Copyright (c) 2016 Elizabeth Mattijsen. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Recent changes can be (re)viewed in the public GIT repository at https://github.com/lizmat/PackUnpack

Feel free to clone your own copy: $ git clone https://github.com/lizmat/PackUnpack

Prerequisites

  • perl6 v6.c

Build/Installation

$ zef install PackUnpack

Author

Elizabeth Mattijsen liz@wenzperl.nl