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 /^\//; }
In reply to Re: Help with a small regex
by hippo
in thread Help with a small regex
by cspctec
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |