IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5212


Ignore:
Timestamp:
Sep 30, 2005, 11:46:55 AM (21 years ago)
Author:
jhoblitt
Message:

don't ouput the CSV header unless there are CSV rows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-MetaDB/scripts/mdb-find-new

    r5198 r5212  
    33# Copyright (C) 2005  Joshua Hoblitt
    44#
    5 # $Id: mdb-find-new,v 1.3 2005-09-30 01:22:53 jhoblitt Exp $
     5# $Id: mdb-find-new,v 1.4 2005-09-30 21:46:55 jhoblitt Exp $
    66
    77use strict;
     
    3434
    3535pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    36 pod2usage( -msg => "Required options: --dsn --user", -exitval => 2 )
     36pod2usage( -msg => "Required options: --dsn --user", -exitval => 3 )
    3737    unless defined $dsn and defined $dbuser;
    3838
     
    5757my $csv = Text::CSV->new();
    5858
    59 print "# ", join(", ", @fields), "\n";
     59print "# ", join(", ", @fields), "\n" if scalar @rows;
    6060foreach my $hashref (@rows) {
    6161    $csv->combine(@$hashref{@fields});
Note: See TracChangeset for help on using the changeset viewer.