On Fri, May 25, 2001 at 11:43:21AM -0400, Craig Moynes/Markham/IBM wrote:
> I have the following regexp:
> 
> @matches = $params{f} =~ /(%[aAbBcCdDehHIjmMnprStTuUVwWyY%])/g;
> 
> If I have a script:
> 
> [snip]
> my @matches;
> my ( %params );
> getopts('DRSa:f:s:d:r:b:w:n:h?', \%params);
> 
> print "$params{f}\n";
> print "@matches\n";
> [snip]
> 
> I am passing -f "some string" in on the command line.
> 
> $params{f} = "%E %e %d";
> output:
> %E %e %d
> %d
> 
> So %e is not found....
> 
> $params{f} = "%d %e";
> output:
> %d %e
> %e
> 
> And now no %d.
> 
> Any ideas why the first match is being lost ?

You must be doing something in the parts you snipped that effects
@matches.  I wrote the following code:

my @matches;
my ( %params );
$params{f} = "%E %e %d";
@matches = $params{f} =~ /(%[aAbBcCdDehHIjmMnprStTuUVwWyY%])/g;
print "$params{f}\n";
print "@matches\n";

And my output was:

%E %e %d
%e %d

Looks fine to me...

Walt

-- 
Walter C. Mankowski
Senior Software Engineer        Myxa Corporation
phone: (610) 234-2626           fax: (610) 234-2640
email: [EMAIL PROTECTED]            http://www.myxa.com

Reply via email to