# vim: set ft=perl:
# -------------------------------------------------------------------
-# $Id: sqlt,v 1.5 2003-10-04 01:22:46 kycl4rk Exp $
+# $Id: sqlt,v 1.6 2003-10-10 16:38:43 dlc Exp $
# -------------------------------------------------------------------
# Copyright (C) 2002 Ken Y. Clark <kclar@cpan.org>,
# darren chamberlain <darren@cpan.org>
use SQL::Translator;
use vars qw( $VERSION );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/;
my $from; # the original database
my $to; # the destination database
'db-password:s' => \$db_password,
) or pod2usage(2);
-my @files = @ARGV; # source files
+my @files = @ARGV || '-'; # source files
pod2usage(1) if $help;
$translator->producer($to);
for my $file (@files) {
- my $output = $translator->translate(file => $file) or die
+ my @args = ($file eq '-') ? (data => \*STDIN) : (file => $file);
+ my $output = $translator->translate(@args) or die
"Error: " . $translator->error;
print $output;
}