Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
プレゼンする人を決める 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