Changeset 2705

Show
Ignore:
Timestamp:
05/10/08 08:50:23
Author:
miyagawa
Message:

use Text::CSV to generate csv as well

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • yapcasia2008/misc/party-prioritize.pl

    r2704 r2705  
    3939} @users; 
    4040 
    41 use YAML; 
     41my $csv = Text::CSV_XS->new({ binary => 1 }); 
     42 
    4243my @cols = qw( user_id first_name last_name is_staff has_accepted_talk country town not_tokyo payment_means paid_date party ); 
    4344 
    44 print join(",", @cols), "\n"; 
     45$csv->combine(@cols); 
     46print $csv->string, "\n"; 
    4547for my $u (sort { $a->{user_id} <=> $b->{user_id} } @sorted) { 
    46     print join(",", @$u{@cols}), "\n"; 
     48    $csv->combine(@$u{@cols}); 
     49    print $csv->string, "\n"; 
    4750} 
    4851