the docos are rather vague aren't they...
I had a look through the test suite and the example file google-calendar, and noticed that
set_calendar($c) seems to be used prior to calling
get_events()... Its entirely possible that this example file is very old and that requirement is now obselete. But FWIW, that was the only difference that jumped out at me while comparing your code with the example...
I haven't got the module installed so can't test it - but hopefully its a step in the right direction...
good hunting...
Update: Added in snippet to which i was referring to...
my @calendars = $cal->get_calendars;
my ($c) = grep { $_->title =~ m!default!i } $cal->get_calendars;
#die "Couldn't get cal\n" unless defined $c;
$c = $calendars[0];
$cal->set_calendar($c);
if (!@ARGV) {
print "Getting events\n";
for ($cal->get_events()) {
#print Dumper $_->as_xml;
#next;
print $_->title."\n";
print $_->id."\n";
my ($start, $finish) = $_->when();
print "${start}-${finish}\n";
#print $_->content->body;
print "\n*****\n\n";
}
exit;
}
Update2: Just noticed that Simon Wistow still considers this module to be Alpha... could well be that
get_events simply doesn't work properly yet...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.