Originally posted by: notfred
Originally posted by: Joony
this cat looks confused
You'd probably be confused too if you tried reading what's on that screen.
sub PluginList{
my %extensions;
my $file = $_[0];
opendir PLUGS, "plugins";
while(my $file = readdir PLUGS){
if($file =~ m/\.pm$/){
my $temp = $file;
$temp =~ s/\.pm$//;
my @exts = split /_/, $temp;
foreach my $ext(@exts){
$extensions{$ext} = $file;
}
}
}
closedir PLUGS;
return \%extensions;
}
That's easy enough to read, although I can't see why you'd split_your_file_names_like_this.pm. Of course, I don't know what you're building...