2 |
|
|
3 |
use strict; |
use strict; |
4 |
|
|
5 |
|
my $debug=1; |
6 |
|
|
7 |
use DBI; |
use DBI; |
8 |
use POSIX qw(strftime); |
use POSIX qw(strftime); |
9 |
|
|
10 |
|
print STDERR "Debug mod: output je u /tmp/debug*\n" if ($debug); |
11 |
|
|
12 |
my $currdate = strftime "%d.%m.%Y %H:%M:%S", localtime; |
my $currdate = strftime "%d.%m.%Y %H:%M:%S", localtime; |
13 |
|
|
14 |
my $html_file=$currdate; |
my $html_file=$currdate; |
15 |
$html_file=~s/ /_/g; |
$html_file=~s/ /_/g; |
16 |
$html_file="izvjestaji/$html_file.html"; |
$html_file="izvjestaji/$html_file.html"; |
17 |
|
|
18 |
|
if (! $debug) { |
19 |
open(HTML,"> $html_file") || die "html: $!"; |
open(HTML,"> $html_file") || die "html: $!"; |
20 |
open(MAIL,"|/usr/lib/sendmail biljana.gombar\@pliva.hr,izvjestaji\@support.pliva.hr") || die "sendmail: $!"; |
open(MAIL,"|/usr/lib/sendmail biljana.gombar\@pliva.hr,izvjestaji\@support.pliva.hr") || die "sendmail: $!"; |
21 |
|
} else { |
22 |
|
open(HTML,"> /tmp/debug$$.html") || die "html: $!"; |
23 |
|
open(MAIL,"> /tmp/debug$$.mail") || die "sendmail: $!"; |
24 |
|
} |
25 |
|
|
26 |
print HTML ' |
print HTML ' |
27 |
<html> |
<html> |
101 |
|
|
102 |
close(HTML); |
close(HTML); |
103 |
close(MAIL); |
close(MAIL); |
104 |
|
|