in reply to Data::ICal::Entry::Todo->new();

"The Todo.pm module just has the annotations and no methods!"

If you did get the right code, then you have misunderstood the code. Open the source code up, you see two things:

  1. The Todo module does have methods defined, for example: optional_unique_properties.
    sub optional_unique_properties { qw( class completed created description dtstamp dtstart geo last-modified location organizer percent-complete priority recurrence-id sequence status summary uid url due duration ); }

    If you do:

    use Data::Dumper; use strict; use Data::ICal::Entry::Todo; my $vtodo = Data::ICal::Entry::Todo->new(); print Dumper($vtodo->optional_unique_properties());

    You get the following, which makes sense.

    $VAR1 = 'class'; $VAR2 = 'completed'; $VAR3 = 'created'; $VAR4 = 'description'; $VAR5 = 'dtstamp'; $VAR6 = 'dtstart'; $VAR7 = 'geo'; $VAR8 = 'last-modified'; $VAR9 = 'location'; $VAR10 = 'organizer'; $VAR11 = 'percent-complete'; $VAR12 = 'priority'; $VAR13 = 'recurrence-id'; $VAR14 = 'sequence'; $VAR15 = 'status'; $VAR16 = 'summary'; $VAR17 = 'uid'; $VAR18 = 'url'; $VAR19 = 'due'; $VAR20 = 'duration';
  2. It is "true" that the Todo module does not have a new() method defined, however, it says:

    use base qw/Data::ICal::Entry/;

    So it inherits new() from its parent - Entry, which does have new():

    sub new { my $class = shift; my $self = { properties => {}, entries => [], }; bless $self, $class; return $self; }

Replies are listed 'Best First'.
Re^2: Data::ICal::Entry::Todo->new();
by perl-pearl (Initiate) on Oct 07, 2005 at 18:10 UTC
    Thank you. I had included the appropriate modules but, did not realize that the method was inherited.