X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FRegexp-Wildcards.git;a=blobdiff_plain;f=lib%2FRegexp%2FWildcards.pm;h=8d79b936abdc19cb2ce7fcd5c12852d738eb5d60;hp=d0f9ab3f134560b14360adb95d99b5a9e3e8577a;hb=152b316b711f68b0027cbdd3e231bb6cd3d9b9a5;hpb=faf1f9f18601b51e4a4fce5dbfb0ed9bbf24e72b diff --git a/lib/Regexp/Wildcards.pm b/lib/Regexp/Wildcards.pm index d0f9ab3..8d79b93 100644 --- a/lib/Regexp/Wildcards.pm +++ b/lib/Regexp/Wildcards.pm @@ -3,8 +3,8 @@ package Regexp::Wildcards; use strict; use warnings; -use Carp qw/croak/; -use Text::Balanced qw/extract_bracketed/; +use Carp qw; +use Text::Balanced qw; =head1 NAME @@ -16,7 +16,7 @@ Version 1.03 =cut -use vars qw/$VERSION/; +use vars qw<$VERSION>; BEGIN { $VERSION = '1.03'; } @@ -34,12 +34,12 @@ BEGIN { $re = $rw->convert('%a_c%', 'sql'); # Turn SQL wildcards into regexps. $rw = Regexp::Wildcards->new( - do => [ qw/jokers brackets/ ], # Do jokers and brackets. - capture => [ qw/any greedy/ ], # Capture *'s greedily. + do => [ qw ], # Do jokers and brackets. + capture => [ qw ], # Capture *'s greedily. ); $rw->do(add => 'groups'); # Don't escape groups. - $rw->capture(rem => [ qw/greedy/ ]); # Actually we want non-greedy matches. + $rw->capture(rem => [ qw ]); # Actually we want non-greedy matches. $re = $rw->convert('*a{,(b)?}?c*'); # '(.*?)a(?:|(b).).c(.*?)' $rw->capture(); # No more captures. @@ -65,20 +65,20 @@ sub _check_self { } my %types = ( - jokers => [ qw/jokers/ ], - sql => [ qw/sql/ ], - commas => [ qw/commas/ ], - brackets => [ qw/brackets/ ], - unix => [ qw/jokers brackets/ ], - win32 => [ qw/jokers commas/ ], + jokers => [ qw ], + sql => [ qw ], + commas => [ qw ], + brackets => [ qw ], + unix => [ qw ], + win32 => [ qw ], ); -$types{$_} = $types{win32} for qw/dos os2 MSWin32 cygwin/; -$types{$_} = $types{unix} for qw/linux +$types{$_} = $types{win32} for qw; +$types{$_} = $types{unix} for qw; my %escapes = ( jokers => '?*', @@ -115,7 +115,7 @@ sub _validate { } my %checked; - for (qw/set add rem/) { + for (qw) { my $opt = $opts{$_}; next unless defined $opt; my $cb = { @@ -310,7 +310,7 @@ No argument means C<< set => [ ] >>. $rw->do(set => 'jokers'); # Only translate jokers. $rw->do('jokers'); # Same. - $rw->do(add => [ qw/sql commas/ ]); # Translate also SQL and commas. + $rw->do(add => [ qw ]); # Translate also SQL and commas. $rw->do(rem => 'jokers'); # Specifying both 'sql' and 'jokers' is useless. $rw->do(); # Translate nothing. @@ -415,7 +415,7 @@ Capture matching C<{ ... , ... }> alternations. $rw->capture(set => 'single'); # Only capture "exactly one" metacharacters. $rw->capture('single'); # Same. - $rw->capture(add => [ qw/any greedy/ ]); # Also greedily capture "any" metacharacters. + $rw->capture(add => [ qw ]); # Also greedily capture "any" metacharacters. $rw->capture(rem => 'greedy'); # No more greed please. $rw->capture(); # Capture nothing.