1 2 3
use Time::localtime; $tm = localtime; ($day, $month, $year) = ($tm->mday, $tm->mon, $tm->year);
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/perl use strict; use warnings; use Getopt::Long; use Win32::Service; use Mail::Sendmail; use Time::localtime; use POSIX; # main-parameeters my %config=( .... );
QuoteC:\Install\TaskController>perl TaskControl.pl --to="xxxx@xxx.de" --se
rvice=Tomcat7 --logmail
Prototype mismatch: sub main::ctime (;$) vs none at TaskControl.pl line 9.
- Verzeichnis NICHT verfuegbar!
1
2
3
4
5
...
WriteLogFile($config{logfilename}," - Tagesordner vorhanden?");
my $dayfolder = $config{logfilename}."\\".POSIX::strftime("%Y-%m-%d", localtime);
if (-e "$dayfolder") {
...
QuoteUsage: POSIX::strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -
1, isdst = -1) at TaskControl_MonitoringDevelop.pl line 74.
1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/perl use strict; use warnings; use 5.010; use POSIX; use Time::localtime (); my %config = ( logfilename => 'ox.log' ); my $dayfolder = $config{logfilename}."\\".POSIX::strftime("%Y-%m-%d", localtime); print $dayfolder;
https://metacpan.org/pod/Time::localtime#DESCRIPTIONTo access this functionality without the core overrides, pass the use an empty import list, and then access function functions with their full qualified names. On the other hand, the built-ins are still available via the CORE:: pseudo-package.