On Tue, 2004-10-26 at 22:00, Chasecreek Systemhouse wrote:
> Interesting.
> 
> Why doesn't this skip already seen letters, I used the
> case-insensitive modifier...
> 
> %seen = ( );
> $string = "AaBbCcDdEeFf";
> while ($string =~ /(.)/gi) {
>     $seen{$1}++;
> }
> print "\n\nunique chars are: ", sort(keys %seen), "\n";
> 
> 'A' and 'a' are the same, or is the logic only char() oriented?
> 
> I guess I'm forced to use lc();

The 'i' modifier only affects the matching of the RE.  If you had a
letter in your RE, it would match either case of that letter.  It
doesn't change the case of the letter, just affects which ones match. 
Since the RE has no letters, the 'i' modifier doesn't do anything here. 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to