Adding content
package StuwerCal::Script::AddBlog;
use 5.010;
use Moose;
use namespace::autoclean;
use MooseX::Types::Path::Class;
with qw( MooseX::Getopt StuwerCal::Role::DB );
has 'file' => (is=>'ro',isa=>'Path::Class::File',required=>1,coerce=>1);
sub run {
my $self = shift;
my %blog;
my @in = $self->file->slurp(iomode => '<:encoding(UTF-8)');
# boring code that fills %blog with the files content
my $blog = $self->schema->resultset('Blog')->create(\%blog);
say "created blog post ".$blog->id;
}