What I am not sure is you have commented all my codes which refer to the CGI queries and fields.
As all the words outside of code tags explain
Because that is the first step in fixing your program
The code as you have posted it cannot be debugged by anybody
Can you re-post your complete code which includes my queries as well or point to me in the right direction?
This is what I have attempted to do in Re: Output to a >CSV file
The "..." is where you fill in the blanks
#!/usr/bin/perl --
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
use DBI;
use Date::Manip ;
use CGI;
Main( @ARGV );
exit( 0 );
sub Main {
my $cgi = CGI->new;
my $start_date = $parms->param("sd");
my $end_date = $parms->param("ed");
my $separator= $parms->param("sep");
my $HOME="/export/home/pmdss";
my $CONFIG="${HOME}/config";
my $ds_mach = CatConfig( "${CONFIG}/BigIron" );
my $dr_mach = CatConfig( "${CONFIG}/BigIronDR" );
my $id = PingerIdOrDeath( $ds_mach , $dr_mach );
my $slotsPortsNodes = sshMeSomeSlotsPortsNodes( $id, $start_date,
+ $end_date );
my( $toNetwork, $domain ) = sshMeSomeObjectIdsDomainNames( $id, $
+end_date );
if ($rows > 0) {
print CsvSlotsHeader( $slotsPortsNodes );
print CsvSlotsData( $slotsPortsNodes );
} else {
print NoData();
}
}
sub CatConfig {
my( $file ) = @_;
...
sub PingerIdOrDeath {
my( $ds_mach, $dr_mach ) = @_;
...
sub sshMeSomeSlotsPortsNodes {
my( $id, $start_date, $end_date ) = @_;
my %network;
...
while ($INPUT_LINE = <input>) {
my %dat;
(
$dat{l_node}, $dat{l_slot}, $dat{l_ifNum},
$dat{r_node}, $dat{r_slot}, $dat{r_line},
$dat{r_port}, $dat{kbps}, $dat{subnetwork},
$dat{subnetwork2}, $dat{r_domain_id}, $dat{icore_domid},
$dat{cust_port}, $dat{track_port}, $dat{vlan_stacking_i
+nv},
$dat{cos_level}, $dat{equip_type_id}
) = split( / /, $INPUT_LINE );
$network{r_node}{$KEY} = $dat{r_node};
$network{r_slot}{$KEY} = $dat{r_slot};
$network{r_port}{$KEY} = $dat{r_port};
...
$network{arraykey}{$KEY}=$KEY;
...
}
return \%network;
}
sub sshMeSomeObjectIdsDomainNames {
my( $id, $end_date ) = @_;
...
sub CsvSlotsHeader {
my($slotsPortsNodes ) = @_;
...
sub CsvSlotsData {
my($slotsPortsNodes) = @_;
...
sub NoData ...
Questions?