use strict;
use warnings;
-use Carp qw/croak/;
-use Text::Balanced qw/extract_bracketed/;
+use Carp qw<croak>;
+use Text::Balanced qw<extract_bracketed>;
=head1 NAME
=cut
-use vars qw/$VERSION/;
+use vars qw<$VERSION>;
BEGIN {
$VERSION = '1.03';
}
$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<jokers brackets> ], # Do jokers and brackets.
+ capture => [ qw<any greedy> ], # 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<greedy> ]); # Actually we want non-greedy matches.
$re = $rw->convert('*a{,(b)?}?c*'); # '(.*?)a(?:|(b).).c(.*?)'
$rw->capture(); # No more captures.
}
my %types = (
- jokers => [ qw/jokers/ ],
- sql => [ qw/sql/ ],
- commas => [ qw/commas/ ],
- brackets => [ qw/brackets/ ],
- unix => [ qw/jokers brackets/ ],
- win32 => [ qw/jokers commas/ ],
+ jokers => [ qw<jokers> ],
+ sql => [ qw<sql> ],
+ commas => [ qw<commas> ],
+ brackets => [ qw<brackets> ],
+ unix => [ qw<jokers brackets> ],
+ win32 => [ qw<jokers commas> ],
);
-$types{$_} = $types{win32} for qw/dos os2 MSWin32 cygwin/;
-$types{$_} = $types{unix} for qw/linux
+$types{$_} = $types{win32} for qw<dos os2 MSWin32 cygwin>;
+$types{$_} = $types{unix} for qw<linux
darwin machten next
aix irix hpux dgux dynixptx
bsdos freebsd openbsd
svr4 solaris sunos dec_osf
- sco_sv unicos unicosmk/;
+ sco_sv unicos unicosmk>;
my %escapes = (
jokers => '?*',
}
my %checked;
- for (qw/set add rem/) {
+ for (qw<set add rem>) {
my $opt = $opts{$_};
next unless defined $opt;
my $cb = {
$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<sql commas> ]); # Translate also SQL and commas.
$rw->do(rem => 'jokers'); # Specifying both 'sql' and 'jokers' is useless.
$rw->do(); # Translate nothing.
$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<any greedy> ]); # Also greedily capture "any" metacharacters.
$rw->capture(rem => 'greedy'); # No more greed please.
$rw->capture(); # Capture nothing.