in reply to Re^11: Recursive search
in thread Recursive search

As file names can contain anything but a slash, match anything but a slash - i.e. [^/]+ - between the last directory separator and .plf:

if ($line =~ m|/([^/]+\.plf$)|) {

Replies are listed 'Best First'.
Re^13: Recursive search
by perl_mystery (Beadle) on Dec 17, 2010 at 23:49 UTC

    doesn't seem to work with $ at the end

      you don't say :)

        :)How do I open a filehandle on some other directory?I want to open the plf on some other directory ,not on the cwd.I know there is opendir and readir but how do I fit in the below code

        open my $fh, '<', $plf or die "could not open '$plf' $!";