Skip Menu |

This queue is for tickets about the Mac-PropertyList CPAN distribution.

Report information
The Basics
Id: 63683
Status: resolved
Priority: 0/
Queue: Mac-PropertyList

People
Owner: Nobody in particular
Requestors: hal [...] deer-run.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Mac::PropertyList::ReadBinary returns unblessed data types
Date: Mon, 6 Dec 2010 15:02:56 -0800
To: bug-Mac-PropertyList [...] rt.cpan.org
From: Hal Pomeranz <hal [...] deer-run.com>
Mac::PropertyList::ReadBinary returns unblessed data types for a few types: [...] my $type_readers = { 0 => sub { # the odd balls my( $self, $length ) = @_; my %hash = ( 0 => [ qw(null 0) ], 8 => [ qw(false 0) ], 9 => [ qw(true 1) ], 15 => [ qw(fill 15) ], ); return $hash{ $length } || []; }, [...] This leads to problems when doing things like this: use Mac::PropertyList; use strict; my $data = Mac::PropertyList::parse_plist_file('myfile.plist'); $ref = $data->as_perl; If the parsed plist file contains any of the data types listed in the hash above, then this above program will bomb out with an error like: Can't call method "value" on unblessed reference at /some/path/to/PropertyList.pm line 675. A partial fix would be to modify the above code for the true/false types: 0 => sub { # the odd balls my( $self, $length ) = @_; return Mac::PropertyList::false->new if ($length == 8); return Mac::PropertyList::true->new if ($length == 9); my %hash = ( 0 => [ qw(null 0) ], 15 => [ qw(fill 15) ], ); return $hash{ $length } || []; }, A complete fix would involve defining object types in Mac::PropertyList for null and fill data and then modifying the above program to return them. Hal Pomeranz hal@deer-run.com
On Mon Dec 06 18:03:05 2010, hal@deer-run.com wrote: Show quoted text
> Mac::PropertyList::ReadBinary returns unblessed data types for a > few types:
I think this is fixed (and tested for) in the 'tests' branch of my fork of this project on GitHub: https://github.com/wiml/mac-propertylist/commit/869592bb1c572415dc49f04011dcd39bb4e3c98d
On Tue Oct 16 04:13:21 2012, WIML wrote: Show quoted text
> On Mon Dec 06 18:03:05 2010, hal@deer-run.com wrote:
> > Mac::PropertyList::ReadBinary returns unblessed data types for a > > few types:
> > I think this is fixed (and tested for) in the 'tests' branch of my > fork > of this project on GitHub:
This is in release 1.38.