Index: /trunk/PS-IPP-MetaDB/scripts/mdb-find-new
===================================================================
--- /trunk/PS-IPP-MetaDB/scripts/mdb-find-new	(revision 5189)
+++ /trunk/PS-IPP-MetaDB/scripts/mdb-find-new	(revision 5190)
@@ -3,5 +3,5 @@
 # Copyright (C) 2005  Joshua Hoblitt
 #
-# $Id: mdb-find-new,v 1.1 2005-09-29 21:28:45 jhoblitt Exp $
+# $Id: mdb-find-new,v 1.2 2005-09-29 22:12:15 jhoblitt Exp $
 
 use strict;
@@ -12,4 +12,5 @@
 
 use PS::IPP::MetaDB;
+use Text::CSV;
 
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
@@ -34,6 +35,4 @@
 pod2usage( -msg => "Required options: --dsn --user", -exitval => 2 )
     unless defined $dsn and defined $dbuser;
-#pod2usage( -msg => "Required options: --exp_id --class_id", -exitval => 2)
-#    unless defined $exp_id and defined $class_id;
 
 PS::IPP::MetaDB->init(
@@ -43,11 +42,21 @@
 );
 
+my @rows;
 if (defined $exp_id) {
-    PS::IPP::MetaDB->find_new(
+    @rows = PS::IPP::MetaDB->find_new(
         exp_id      => $exp_id,
         class_id    => $class_id,
     );
 } else {
-    PS::IPP::MetaDB->find_new();
+    @rows = PS::IPP::MetaDB->find_new();
+}
+
+my @fields = qw( exp_id class_id camera class url );
+my $csv = Text::CSV->new();
+
+print "# ", join(", ", @fields), "\n";
+foreach my $hashref (@rows) {
+    $csv->combine(@$hashref{@fields});
+    print $csv->string, "\n";
 }
 
