Skip to content

Instantly share code, notes, and snippets.

@catatsuy
Created November 20, 2012 16:08
Show Gist options
  • Save catatsuy/4118860 to your computer and use it in GitHub Desktop.
Save catatsuy/4118860 to your computer and use it in GitHub Desktop.
プレゼンする人を決める Perl スクリプト
use strict;
use warnings;
use utf8;
use IO::File;
use Text::CSV_XS;
use List::Util qw/shuffle/;
binmode STDOUT, ':utf8';
my $file = IO::File->new('entry.csv', 'r') or die 'Could not open ' . $!;
binmode $file, ':utf8';
my $csv = Text::CSV_XS->new({ binary => 1 });
my @presenters = qw/飛び入り参加/; # 飛び入り参加
while (my $_ = $csv->getline($file)) {
if ($. == 1) {
next;
}
push @presenters, $_->[0];
}
$file->close;
@presenters = shuffle @presenters;
my $number = 1;
print $number++ . '. ' . $_ . "\n" for @presenters;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment