[Bps-public-commit] r14018 - Data-Plist
alexmv at bestpractical.com
alexmv at bestpractical.com
Fri Jul 11 15:22:34 EDT 2008
Author: alexmv
Date: Fri Jul 11 15:22:25 2008
New Revision: 14018
Added:
Data-Plist/ical-import.pl
Modified:
Data-Plist/ (props changed)
Log:
r34070 at kohr-ah: chmrr | 2008-07-11 15:22:10 -0400
* Test ical plist import file
Added: Data-Plist/ical-import.pl
==============================================================================
--- (empty file)
+++ Data-Plist/ical-import.pl Fri Jul 11 15:22:25 2008
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use lib 'lib';
+use YAML;
+use Data::Plist;
+use Data::Plist::BinaryReader;
+use Email::MIME;
+use File::Slurp;
+
+for my $f (@ARGV) {
+ my $content = read_file($f);
+ unless ($content =~ /^bplist/) {
+ my $mime = Email::MIME->new( $content );
+ $content = ($mime->parts)[1]->body;
+ }
+
+ my $p = Data::Plist::BinaryReader->open_string($content);
+ my $o = $p->object;
+ print YAML::Dump($p->object);
+}
More information about the Bps-public-commit
mailing list