Data::PropertyList 1998.1217 review
DownloadData::PropertyList is a Perl module that can convert arbitrary objects to/from strings. SYNOPSIS use Data::PropertyList qw(as
|
|
Data::PropertyList is a Perl module that can convert arbitrary objects to/from strings.
SYNOPSIS
use Data::PropertyList qw(astext fromtext);
$hash_ref = { 'items' => [ 7 .. 11 ], 'key' => 'value' };
$string = astext($hash_ref);
# ...
$hash_ref = fromtext($string);
print $hash_ref->{'items'}[0];
$array_ref = [ 1, { 'key' => 'value' }, 'Omega' ];
$string = astext($array_ref);
# ...
$array_ref = fromtext($string, '-array'=>1 );
print $array_ref->[1]{'key'};
Data::Propertylist provides functions that turn data structures with nested references into NeXT's Property List text format and back again.
You may find this useful for saving and loading application information in text files, or perhaps for generating error messages while debugging.
astext( $reference ) : $propertylist_string;
Writes out a nested Perl data structure in NeXT property list format.
fromtext( $propertylist_string ) : $hash_ref
fromtext( $propertylist_string, '-array'=>1 ) : $array_ref
Reconstructs a Perl data structure of nested references and scalars from a NeXT property list. Use the -array flag if the string encodes an array rather than a hash.
Requirements:
Perl
Data::PropertyList 1998.1217 search tags