mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
Use more elegant Perlish method to print supported languages
This commit is contained in:
parent
a41906d323
commit
a0f0249c8f
@ -17,13 +17,7 @@ eval {
|
||||
my @languages = glob 'languages/*.pm';
|
||||
my $comma = '';
|
||||
print "Supported languages are: ";
|
||||
foreach my $lang (sort @languages) {
|
||||
$lang = basename($lang);
|
||||
next if $lang =~ m/^_|~$/g;
|
||||
$lang =~ s/\.pm$//;
|
||||
print "$comma$lang";
|
||||
$comma = ', ';
|
||||
}
|
||||
print join(", ", grep { $_ = basename $_; $_ =~ s/.pm$//; $_ !~ m/^_/ } sort @languages);
|
||||
print "\n";
|
||||
|
||||
exit;
|
||||
|
Loading…
Reference in New Issue
Block a user