F
florian.haas
Hi !
I am using File::find to recursively go through a certain directory.
I have a String containing the file extensions that i am looking for
(separated by commas). I split that String up and try to match the
filenames to the extension.
Somehow i am unable to get it to work.
(My aim is to only get Files with the extensions .c, .d or .e)
$extensions = ".c,.d ,.e"
sub foundfile {
my $abortboolean= "true";
return unless -f $_; # Only Files are interesting
my @extensionarray = split(/,[' ']?/, $extension);
my $array_element ;
foreach $array_element(@extensionarray)
{if (/$$array_element/i){$abortboolean="false";}}
if ($abortboolean eq "true"){return;}
print "File $_ is ok\n";
}
Any help is apreciated.
By the Way: Do you know a good Regexp-Tutorial ?
I am using File::find to recursively go through a certain directory.
I have a String containing the file extensions that i am looking for
(separated by commas). I split that String up and try to match the
filenames to the extension.
Somehow i am unable to get it to work.
(My aim is to only get Files with the extensions .c, .d or .e)
$extensions = ".c,.d ,.e"
sub foundfile {
my $abortboolean= "true";
return unless -f $_; # Only Files are interesting
my @extensionarray = split(/,[' ']?/, $extension);
my $array_element ;
foreach $array_element(@extensionarray)
{if (/$$array_element/i){$abortboolean="false";}}
if ($abortboolean eq "true"){return;}
print "File $_ is ok\n";
}
Any help is apreciated.
By the Way: Do you know a good Regexp-Tutorial ?