in reply to Combining regexes

Hi davies,

One Way To Do It... without regexen ;-)

use Path::Class qw/file dir/; my $startdir = dir('/Y/Music/'); my $curdir = dir('/Y/Music/Schubert/Lieder/Terfel'); my $plsname = join('_', grep {length} $curdir->relative($startdir)->components).".pls"; print "$plsname\n"; __END__ Schubert_Lieder_Terfel.pls

I used unixish paths but it works the same on Windows. The grep {length} may not be necessary, I just figured it was the closest equivalent to your s/^_?//;.

Path::Class::Dir also has functions for searching that can replace File::Find.

Hope this helps,
-- Hauke D