Subject: | not checking for array value |
Trying to read and dump the YAPC::NA 2011 schedule in iCal format:
----------------------------------------
#!/usr/bin/perl
# http://www.yapc2011.us/yn2011/timetable.ics
my $yapc_2011_ical = 'yapc-2011/timetable.ics';
use Tie::iCal;
tie %my_events, 'Tie::iCal', $yapc_2011_ical
or die "Couldnt tie ical file ($yapc_2011_ical): $!";
use Data::Dumper;
print Dumper \%my_events;
----------------------------------------
produces this complaint:
% bin/ical2perl.pl
Can't use string ("Michael Krabll") as an ARRAY ref while "strict refs"
in use at /usr/share/perl5/Tie/iCal.pm line 553, <$fh> line 3960.
Changing line 553 from:
----------------------------------------
if (!(@{$e{$name}} && !grep({ref($_) ne 'ARRAY'} @{$e{$name}}))) {
# not a strict list of arrays
to:
if (!(ref $e{$name} eq 'ARRAY' &&
@{$e{$name}} && !grep({ref($_) ne 'ARRAY'} @{$e{$name}}))) {
# not a strict list of arrays
----------------------------------------
allows it to work, but I haven't checked to see that the resulting parse
is correct.
Subject: | timetable.ics.orig |
Message body not shown because it is not plain text.