in reply to Help with a small regex

If you really only want to test for "/home/example/testdir" then this should work:

foreach (@data) { my $match = $_ if /testdir/; }

OTOH, if the spec is actually to match against just a path then this should do:

foreach (@data) { my $match = $_ if /^\//; }