Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/env perl
- my @dirs = ("abc/pfr/def/","abc/pfr/ghi/");
- print "@dirs\n";
- my @foo = grep { /pfr/ } @dirs;
- print "@foo\n";
- if ( @dirs ~~ @foo ) {
- print "match\n";
- }
- if ( @dirs ~~ grep { /pfr/ } @dirs ) {
- print "match\n";
- } else {
- print "no match\n";
- }
- #### OUTPUT ####
- abc/pfr/def/ abc/pfr/ghi/
- abc/pfr/def/ abc/pfr/ghi/
- match
- no match
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement