diff options
author | Mark Jason Dominus <mjd@plover.com> | 2011-09-09 00:18:47 -0500 |
---|---|---|
committer | Dave Rolsky <autarch@urth.org> | 2011-09-09 00:18:47 -0500 |
commit | 4e848ca977b29932dcb7cc8c716cb661868cb91c (patch) | |
tree | 88c60488641b6668b2c87b135223ecb1e77b691d /pod/perlpacktut.pod | |
parent | 77cb3b015781b8e3c7ee73c313ba18cd16dfb442 (diff) | |
download | perl-4e848ca977b29932dcb7cc8c716cb661868cb91c.tar.gz |
Simplify example pack code in perlpacktut
Diffstat (limited to 'pod/perlpacktut.pod')
-rw-r--r-- | pod/perlpacktut.pod | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pod/perlpacktut.pod b/pod/perlpacktut.pod index 7d2126a0ea..2ce56622b7 100644 --- a/pod/perlpacktut.pod +++ b/pod/perlpacktut.pod @@ -73,14 +73,13 @@ remains. The inverse operation - packing byte contents from a string of hexadecimal digits - is just as easily written. For instance: - my $s = pack( 'H2' x 10, map { "3$_" } ( 0..9 ) ); + my $s = pack( 'H2' x 10, 30..39 ); print "$s\n"; Since we feed a list of ten 2-digit hexadecimal strings to C<pack>, the pack template should contain ten pack codes. If this is run on a computer with ASCII character coding, it will print C<0123456789>. - =head1 Packing Text Let's suppose you've got to read in a data file like this: |