Permalink
Browse files

Merge branch 'master' of git://github.com/dhoss/perl-survey-2009

  • Loading branch information...
2 parents bb05f95 + f319824 commit e02ef9b30d56cb2d93f02455cbcc9f659bc9564d Kieren Diment committed Apr 3, 2010
Showing with 10 additions and 3 deletions.
  1. BIN Survey-Perl/db/answers.db
  2. +10 −3 Survey-Perl/script/survey_csv_matrix.pl
View
Binary file not shown.
@@ -15,9 +15,16 @@
while ( my $answer = $answer_rs->next ) {
print Dumper $answer->columns;
- for ( $answer->columns ) {
- print $fh $_ . "," . $answer->$_ . "\n"
- or die "couldn't write row: $!";
+ for my $column ( $answer->columns ) {
+ if ( ref $answer->$column eq "ARRAY" ) {
+ print "Arrayref found\n";
+ print $fh $column . "," . @{$answer->$column} . "\n"
+ or die "couldn't write row: $!";
+ }
+ else {
+ print $fh $column . "," . $answer->$column . "\n"
+ or die "couldn't write row: $!";
+ }
}
}
close $fh;

0 comments on commit e02ef9b

Please sign in to comment.