T
Ted Zlatanov
I think it would be really useful if in addition to $File::Find::name
and $_ there were also $File::Find::namenoext, $_namenoext ($_ without
the extension), and $File::Find::ext (the extension itself). On most
OSs it should be true that
$File::Find::namenoext . '.' . $File::Find::ext eq $File::Find::name
$_namenoext . '.' . $File::Find::ext eq $_
but when the extension is undef, $_namenoext eq $_ (I think undef is
better than '' for an empty extension, and would distinguish nicely
between "filename." and "filename").
I do this all the time by hand inside the wanted() function, and I think
an extra string match and three more variables won't hurt File::Find too
much. It's already IO-bound in the find() function.
The code for this is easy, but this is a core module so before producing
a patch I thought I'd ask: has it been done before, and did I miss
something in File::Find? I didn't find suggestions of this feature in
newsgroup or Google archives, but I'd like to hear if anyone has
suggestions for or against it.
Ted
and $_ there were also $File::Find::namenoext, $_namenoext ($_ without
the extension), and $File::Find::ext (the extension itself). On most
OSs it should be true that
$File::Find::namenoext . '.' . $File::Find::ext eq $File::Find::name
$_namenoext . '.' . $File::Find::ext eq $_
but when the extension is undef, $_namenoext eq $_ (I think undef is
better than '' for an empty extension, and would distinguish nicely
between "filename." and "filename").
I do this all the time by hand inside the wanted() function, and I think
an extra string match and three more variables won't hurt File::Find too
much. It's already IO-bound in the find() function.
The code for this is easy, but this is a core module so before producing
a patch I thought I'd ask: has it been done before, and did I miss
something in File::Find? I didn't find suggestions of this feature in
newsgroup or Google archives, but I'd like to hear if anyone has
suggestions for or against it.
Ted