if (-e $pfad."/edit"."/[pl\cgi]/") {...}
if (-e $pfad."/edit.pl" or -e $pfad."/edit.cgi") {...}
12345678
foreach my $ext (qw/pl cgi/){ if(-e "$path/edit.$ext") { #... last; }}