Text::Glob - match globbing patterns against text
use Text::Glob qw( match_glob glob_to_regex ); print "matched\n" if match_glob( "foo.*", "foo.bar" ); # prints foo.bar and foo.baz my $regex = glob_to_regex( "foo.*" ); for ( qw( foo.bar foo.baz foo bar ) ) { print "matched: $_\n" if /$regex/; }
perl Build.PL perl Build test
and if all goes well
perl Build install
What changed over the last 3 revisions
- port to Module::Build - Nested alternations fix from Mike Benson
- !match_glob("*.foo", "foo/.foo"); - test suite overhaul - backslash expansion fixed - /[+^$|]/ made less 'special' - handle embedded newlines in glob patterns - add tests for 'foo[abc]' - Many thanks go to Nick Cleaton for finding these
- $Text::Glob::{strict_leading_dot,strict_wildcard_slash} from bug report from Nick Cleaton - (quite poor) documentation of supported globbing constructs
Richard Clamp <richardc@unixbeard.net>
Copyright (C) 2002 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
File::Glob, glob(3)
To install Text::Glob, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Glob
CPAN shell
perl -MCPAN -e shell install Text::Glob
For more information on module installation, please visit the detailed CPAN module installation guide.