This commit is contained in:
mynah
2020-01-22 18:22:31 -06:00
parent f16d579996
commit 174f4b0756
38 changed files with 503 additions and 473 deletions

View File

@@ -2,7 +2,7 @@ package Dojo::Support;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT = qw/ mtxt commify month_num2txt log dmph merge_hash load_module get_names /;
our @EXPORT = qw/send_mail mtxt commify month_names month_num2txt log dmph merge_hash load_module get_names /;
use Mojo::Base 'Mojolicious';
use File::Basename;
@@ -18,6 +18,11 @@ sub log{
$log->debug("============ ".shift." ===========");
}
sub _log{
my $log = Mojo::Log->new;
$log->debug("============ ".shift." ===========");
}
sub get_names{
my $dir = shift;
my @file_name;
@@ -45,6 +50,10 @@ sub month_num2txt{
return ("enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre" =~ m/\w+/g)[shift (@_) -1];
}
sub month_names{
return qw /enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre/;
}
sub mtxt {
my ($di, $mi, $df, $mf)=@_; # dini,mini,dfin,mfin
my $txt;
@@ -89,5 +98,10 @@ sub dmph{
return $y;
}
sub send_mail{ #msg header mail
system( 'echo "'.shift.'" | mutt -s '.shift.' '.shift.' &');
_log("mail sent");
return 0;
}
1;