Parse::Binary::FixedFormat 0.10
Parse::Binary::FixedFormat is a Perl module to convert between fixed-length fields and hashes. SYNOPSIS use Parse::Binary::F
|
|||||||||||||||||||
Parse::Binary::FixedFormat is a Perl module to convert between fixed-length fields and hashes.
SYNOPSIS
use Parse::Binary::FixedFormat;
my $tarhdr =
new Parse::Binary::FixedFormat [ qw(name:a100 mode:a8 uid:a8 gid:a8 size:a12
mtime:a12 chksum:a8 typeflag:a1 linkname:a100
magic:a6 version:a2 uname:a32 gname:a32
devmajor:a8 devminor:a8 prefix:a155) ];
my $buf;
read TARFILE, $buf, 512;
# create a hash from the buffer read from the file
my $hdr = $tarhdr->unformat($buf); # $hdr gets a hash ref
# create a flat record from a hash reference
my $buf = $tarhdr->format($hdr); # $hdr is a hash ref
# create a hash for a new record
my $newrec = $tarhdr->blank();
Parse::Binary::FixedFormat can be used to convert between a buffer with fixed-length field definitions and a hash with named entries for each field. The perl pack and unpack functions are used to perform the conversions. Parse::Binary::FixedFormat builds the format string by concatenating the field descriptions and converts between the lists used by pack and unpack and a hash that can be reference by field name.
Requirements:
tags
Download Parse::Binary::FixedFormat 0.10
Authors software
|
|
|
|
|
|
|
|
Similar software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other software in this category
|
|
|
|
|
|
|
|
|
|
Featured Software
jEdit 4.3 pre8
jEdit is an Open Source text editor written in Java
Opera 9.02
Surf the Internet in a safer, faster, and easier way with Opera browser
GNU Aspell 0.60.4
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell
- Communications
- Database
- Desktop Environment
- Games
- Internet
- Multimedia
- Office
- Programming
- Science and Engineering
- System
- Text Editing&Processing
