X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FRegexp-Wildcards.git;a=blobdiff_plain;f=samples%2Fwc2re.pl;h=29603163145075ed29a8b2f79bc413006d9be092;hp=49a78909dd0b86fdb7cf4ad5e07ef71df96d6d09;hb=152b316b711f68b0027cbdd3e231bb6cd3d9b9a5;hpb=6305572fe1d1790682966644ede8f267f22bd1d1 diff --git a/samples/wc2re.pl b/samples/wc2re.pl index 49a7890..2960316 100755 --- a/samples/wc2re.pl +++ b/samples/wc2re.pl @@ -3,16 +3,16 @@ use strict; use warnings; -use lib q:../lib/:; +use lib qw; -use Regexp::Wildcards qw/wc2re/; +use Regexp::Wildcards; +use Data::Dumper; -my $type = (grep $^O eq $_, qw/dos os2 MSWin32 cygwin/) ? 'win32' : 'unix'; -print "For this system, type is $type\n"; - -{ - local $Regexp::Wildcards::CaptureBrackets = 1; - local $Regexp::Wildcards::CaptureAny = -1; - print $_, ' => ', wc2re($_ => $^O), "\n" for @ARGV; -} +my $rw = Regexp::Wildcards->new( + do => [ qw ], + capture => [ qw ], +); +$rw->do(add => [ qw ]); +$rw->capture(add => [ qw ]); +print $_, ' => ', $rw->convert($_), "\n" for @ARGV;