package App::TodoList;
use strict;
use warnings;
use JSON;
use File::HomeDir;
use File::Spec;
our $VERSION = '1.0.0';
sub new {
my ($class, %args) = @_;
my $home_dir = File::HomeDir->my_
home;
my $file = File::Spec->catfile($home_dir, '.tasks.json');
my $self = {
file => $args{file} || $file,
tasks => [],
};
bless $self, $class;
$self->_load_tas
file '$self->{file}': $!";
local $/;
my $json = <$fh>;
close $fh;
$self->{tasks} = decode_json($json) if $json;
}
}
sub _save_tasks {
my ($self) = @_;
ope