Changeset 5190 for trunk/PS-IPP-MetaDB/scripts/mdb-find-new
- Timestamp:
- Sep 29, 2005, 12:12:15 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-MetaDB/scripts/mdb-find-new (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-MetaDB/scripts/mdb-find-new
r5187 r5190 3 3 # Copyright (C) 2005 Joshua Hoblitt 4 4 # 5 # $Id: mdb-find-new,v 1. 1 2005-09-29 21:28:45 jhoblitt Exp $5 # $Id: mdb-find-new,v 1.2 2005-09-29 22:12:15 jhoblitt Exp $ 6 6 7 7 use strict; … … 12 12 13 13 use PS::IPP::MetaDB; 14 use Text::CSV; 14 15 15 16 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 34 35 pod2usage( -msg => "Required options: --dsn --user", -exitval => 2 ) 35 36 unless defined $dsn and defined $dbuser; 36 #pod2usage( -msg => "Required options: --exp_id --class_id", -exitval => 2)37 # unless defined $exp_id and defined $class_id;38 37 39 38 PS::IPP::MetaDB->init( … … 43 42 ); 44 43 44 my @rows; 45 45 if (defined $exp_id) { 46 PS::IPP::MetaDB->find_new(46 @rows = PS::IPP::MetaDB->find_new( 47 47 exp_id => $exp_id, 48 48 class_id => $class_id, 49 49 ); 50 50 } else { 51 PS::IPP::MetaDB->find_new(); 51 @rows = PS::IPP::MetaDB->find_new(); 52 } 53 54 my @fields = qw( exp_id class_id camera class url ); 55 my $csv = Text::CSV->new(); 56 57 print "# ", join(", ", @fields), "\n"; 58 foreach my $hashref (@rows) { 59 $csv->combine(@$hashref{@fields}); 60 print $csv->string, "\n"; 52 61 } 53 62
Note:
See TracChangeset
for help on using the changeset viewer.
