3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

Use more elegant Perlish method to print supported languages

This commit is contained in:
Pragmatic Software 2015-01-18 18:49:36 -08:00
parent a41906d323
commit a0f0249c8f

View File

@ -17,13 +17,7 @@ eval {
my @languages = glob 'languages/*.pm'; my @languages = glob 'languages/*.pm';
my $comma = ''; my $comma = '';
print "Supported languages are: "; print "Supported languages are: ";
foreach my $lang (sort @languages) { print join(", ", grep { $_ = basename $_; $_ =~ s/.pm$//; $_ !~ m/^_/ } sort @languages);
$lang = basename($lang);
next if $lang =~ m/^_|~$/g;
$lang =~ s/\.pm$//;
print "$comma$lang";
$comma = ', ';
}
print "\n"; print "\n";
exit; exit;