Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Output to a >CSV file

by Anonymous Monk
on Feb 13, 2020 at 22:37 UTC ( #11112943=note: print w/replies, xml ) Need Help??


in reply to Re^2: Output to a >CSV file
in thread Output to a >CSV file

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11112943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2020-03-29 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (169 votes). Check out past polls.

    Notices?