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?


In reply to Re^3: Output to a >CSV file by Anonymous Monk
in thread Output to a >CSV file by pragovnj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.