Created
April 30, 2010 22:09
-
-
Save osfameron/385829 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Data::Dumper; | |
use DBI; | |
my $dbh = DBI->connect( 'dbi:CSV:', '', '', | |
{f_dir => '.', | |
f_ext => ".asc/r", | |
csv_sep_char => "\t", | |
}) | |
or die "Cannot connect $DBI::errstr"; | |
$dbh->{csv_tables}{table1} = { | |
col_names => [qw/ alpha bravo charlie delta echo foxtrot /], | |
}; | |
my $sth = $dbh->prepare( | |
'select alpha, charlie, echo from table1 | |
order by alpha, bravo, charlie, delta, echo, foxtrot' | |
) or die $dbh->errstr; | |
$sth->execute or die $sth->errstr; | |
print Dumper( $sth->fetchall_arrayref({}) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment