Sorry, ich bin etwas durch ... also nochmal:
$File_anfang="C:\ABC.1\datei";
my @FILES = <*.txt>;
if (@FILES)
{
LOG_MESSAGE("### file found");
foreach my $File (@FILES)
{
#$File ist C:\ABC.1\datei1.txt
if ($File =~ /${File_anfang}(\d+).txt$/)
{
print "So solls sein ! => $1";
}
else {print "Mist";}
Und das geht nicht! So hoffe es ist klar nun.