Mac::Tie::PList - Parse Apple NSDictionary objects (e.g. Preference Lists)


Mac-Tie-PList documentation  | view source Contained in the Mac-Tie-PList distribution.

Index


NAME

Top

Mac::Tie::PList - Parse Apple NSDictionary objects (e.g. Preference Lists)

SYNOPSIS

Top

use Mac::Tie::PList;

    my $plist = Mac::Tie::PList->new_from_file("/Library/Preferences/.GlobalPreferences.plist");

    while ((my $key,$val) = each %$plist) {
    	print "$key => $val\n";
    }




DESCRIPTION

Top

This module allows you to parse NSDictionary objects, as used in PList files, as tied perl objects. It uses the Foundation perl/objective-c bridge and so both xml1 and binary1 formats are currently supported.

The objects are mapped as follows:

	NSNumber NSBoolean NSString => perl tied scalar
	NSArray => perl tied array
	NSDictionary => perl tied hash
	NSDate => perl tied string - returns seconds since 1970
	NSData => *WARNING* The returned sting format is not decided yet

NOTE: Currently the module only provided read access to the data. Write access is planned in the future.

my $hash_ref = Mac::Tie::PList->new($data)

Parses data and creates a new tied hash based on the data provided as a string.

my $hash_ref = Mac::Tie::PList->new_from_file($filename)

Parses data and creates a new tied hash based on the contents of a file.

SEE ALSO

Top

This module is based on code from the following O'Reilly article:

	http://www.macdevcenter.com/pub/a/mac/2005/07/29/plist.html

The Objective C Bridge is descibed at:

	http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/PerlObjCBridge.3pm.html

Further details of NSDictionary's is available here:

	http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_cla
ssic/Classes/NSDictionary.html

AUTHOR

Top

Gavin Brock, <gbrock@cpan.org>

COPYRIGHT AND LICENSE

Top


Mac-Tie-PList documentation  | view source Contained in the Mac-Tie-PList distribution.