Skip to content

Instantly share code, notes, and snippets.

@wakaba
Created November 21, 2013 07:43
Show Gist options
  • Save wakaba/7577468 to your computer and use it in GitHub Desktop.
Save wakaba/7577468 to your computer and use it in GitHub Desktop.
sub install_perl_apps_by_file ($$$) {
my ($perl_command, $perl_version, $file_name) = @_;
info_die "|$file_name| not found" unless -f $file_name;
open my $file, '<', $file_name or info_die "$file_name: $!";
while (<$file>) {
tr/\x0D\x0A//d;
if (/^#/) {
#
} elsif (/^(\S+)\s+(\S+)$/) {
install_perl_app $perl_command, $perl_version, $1, name => $2;
} elsif (/^(\S+)$/) {
install_perl_app $perl_command, $perl_version, $1;
}
}
} # install_perl_apps_by_file
} elsif ($command->{type} eq 'install-perl-apps-by-list') {
my $file_name = "$RootDirName/config/perl/apps.txt";
if (-f $file_name) {
install_perl_apps_by_file $PerlCommand, $perl_version, $file_name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment