| Data-Plist documentation | Contained in the Data-Plist distribution. |
Data::Plist::Reader - Abstract superclass for BinaryReader
# Create new $read = Data::Plist::BinaryReader->new; # Reading from a string C<$str> my $plist = $read->open_string($str); # Writing from file C<$filename> $plist = $read->read($filename);
Data::Plist::Reader is an abstract superclass of
BinaryReader. Takes either a string or a filehandle containing data
formatted as an Apple property list and returns it as a
Data::Plist.
Create a new reader.
Takes binary data $content and reads it into a
filehandle. Then passes that filehandle to open_fh.
Takes a filename $filename and reads its data into a
filehandle. Then passes the filehandle to open_fh.
Place-holder method for Reader's subclass. Currently unimplemented.
| Data-Plist documentation | Contained in the Data-Plist distribution. |
package Data::Plist::Reader; use strict; use warnings;
sub new { my $class = shift; return bless {} => $class; }
sub open_string { my $self = shift; my ($content) = @_; my $fh; open( $fh, "<", \$content ); return $self->open_fh($fh); }
sub open_file { my $self = shift; my ($filename) = @_; my $fh; open( $fh, "<", $filename ) or die "can't open $filename for conversion"; binmode($fh); return $self->open_fh($fh); }
sub open_fh { my $self = shift; die "Unimplemented!"; } 1;