Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Text::Glob

Name Text::Glob
Version 0.11
Located at /usr/share/perl5/vendor_perl
File /usr/share/perl5/vendor_perl/Text/Glob.pm
Is Core No
Search CPAN for this module Text::Glob
Documentation Text::Glob
Module Details Text::Glob

NAME

Text::Glob - match globbing patterns against text


SYNOPSIS

 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/;
 }


DESCRIPTION

Text::Glob implements glob(3) style matching that can be used to match against text, rather than fetching names from a filesystem. If you want to do full file globbing use the File::Glob module instead.

Routines

match_glob( $glob, @things_to_test )
Returns the list of things which match the glob from the source list.

glob_to_regex( $glob )
Returns a compiled regex which is the equivalent of the globbing pattern.

glob_to_regex_string( $glob )
Returns a regex string which is the equivalent of the globbing pattern.


SYNTAX

The following metacharacters and rules are respected.


BUGS

The code uses qr// to produce compiled regexes, therefore this module requires perl version 5.005_03 or newer.


AUTHOR

Richard Clamp <richardc@unixbeard.net>


COPYRIGHT

Copyright (C) 2002, 2003, 2006, 2007 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.


SEE ALSO

the File::Glob manpage, glob(3)

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024