Subject: | No todo.pm |
It seems that portability and extensibility would be ehnanced by having
a todo.pm.
I'd like to do something like this:
use Hiveminder::TODO qw(asTodoTxt);
my $item = Hiveminder::TODO->new();
$item->due('Monday');
$item->priority('high');
$item->priority()++; # Overloaded increment l-value???
$item->description(<<END_DESCRIPTION);
yada yada yada...
more stuff
and more stuff
END_DESCRIPTION
item->tags(qw(hacking eating sleeping));
print $item;
or
print $item->asText(); # Braindump-wise
or
print $item->asTodoTxt(); # Todo.txt-wise
open my $todo_fh, '>', 'todo.txt' or die $!;
$todo_text = $item->asTodoTxt();
print $todo_fh $todo_txt;
close $todo_fh;
my $parser = TODO->parser();
my $new_item_from_text = $parser->parse($todo_text);
my $new_item_from_file_handle = $parser->parseFile($todo_fh);
my $new_item_from_file_name = $parser->parseFile('todo.txt');