|
Lines 66-71
runreport.pl [ -h | -m ] [ -v ] reportID [ reportID ... ]
Link Here
|
| 66 |
--from=s e-mail address to send report from |
66 |
--from=s e-mail address to send report from |
| 67 |
--subject=s subject for the e-mail |
67 |
--subject=s subject for the e-mail |
| 68 |
--store-results store the result of the report |
68 |
--store-results store the result of the report |
|
|
69 |
--csv-header add column names as first line of csv output |
| 69 |
|
70 |
|
| 70 |
|
71 |
|
| 71 |
Arguments: |
72 |
Arguments: |
|
Lines 175-180
my $subject = "";
Link Here
|
| 175 |
my $separator = ','; |
176 |
my $separator = ','; |
| 176 |
my $quote = '"'; |
177 |
my $quote = '"'; |
| 177 |
my $store_results = 0; |
178 |
my $store_results = 0; |
|
|
179 |
my $csv_header = 0; |
| 178 |
|
180 |
|
| 179 |
my $username = undef; |
181 |
my $username = undef; |
| 180 |
my $password = undef; |
182 |
my $password = undef; |
|
Lines 194-199
GetOptions(
Link Here
|
| 194 |
'password:s' => \$password, |
196 |
'password:s' => \$password, |
| 195 |
'method:s' => \$method, |
197 |
'method:s' => \$method, |
| 196 |
'store-results' => \$store_results, |
198 |
'store-results' => \$store_results, |
|
|
199 |
'csv-header' => \$csv_header, |
| 197 |
|
200 |
|
| 198 |
) or pod2usage(2); |
201 |
) or pod2usage(2); |
| 199 |
pod2usage( -verbose => 2 ) if ($man); |
202 |
pod2usage( -verbose => 2 ) if ($man); |
|
Lines 273-278
foreach my $report_id (@ARGV) {
Link Here
|
| 273 |
quote_char => $quote, |
276 |
quote_char => $quote, |
| 274 |
sep_char => $separator, |
277 |
sep_char => $separator, |
| 275 |
}); |
278 |
}); |
|
|
279 |
|
| 280 |
if ( $csv_header ) { |
| 281 |
my $fields = $sth->{NAME}; |
| 282 |
$csv->combine( @$fields ); |
| 283 |
$message .= $csv->string() . "\n"; |
| 284 |
push @rows_to_store, [@$fields] if $store_results; |
| 285 |
} |
| 286 |
|
| 276 |
while (my $line = $sth->fetchrow_arrayref) { |
287 |
while (my $line = $sth->fetchrow_arrayref) { |
| 277 |
$csv->combine(@$line); |
288 |
$csv->combine(@$line); |
| 278 |
$message .= $csv->string() . "\n"; |
289 |
$message .= $csv->string() . "\n"; |
| 279 |
- |
|
|