#!c:/perl/bin/perl -w use strict; my $make_report = 1; my $make_dbimport = 1; my $hfnetchk_dir = "c:/progra~1/shavli~1/hfnetchk"; my $hfnetchk = "${hfnetchk_dir}/hfnetchk.exe"; my $hfnetchk_switches = "-o tab -s 2"; my $report = "${hfnetchk_dir}/report.txt"; my $dbimport = "${hfnetchk_dir}/dbimport.txt"; my $time = scalar localtime; my $fh; open $fh, "$hfnetchk $hfnetchk_switches |"; my @lines = <$fh>; close $fh; chomp @lines; my @fieldnames = split "\t", shift @lines; my @items; my $l; for $l (@lines) { push @items, [ split "\t", $l ]; } my $out; if ($make_report) { open $out, "> $report"; print $out $hfnetchk, " output on ", $time, "\n"; for $l (@lines) { print $out $l, "\n"; } close $out; } if ($make_dbimport) { my $i; open $out, "> $dbimport"; for $i (@items) { @{$i} = map { s/"/'/g ; $_ } @{$i}; print $out '"', join('","', $time, @{$i}), '"', "\n"; } close $out; }