プレゼンする人を決める Perl スクリプト
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 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