Re: What does "=<" means?

2011-12-30 Thread John Riselvato
in this code what is the $n =~ /$b/i; On Fri, Dec 30, 2011 at 11:53 AM, John Riselvato wrote: > in this code what is the > $n =~ /$b/i; > > > On Fri, Dec 30, 2011 at 10:51 AM, Igor Dovgiy wrote: > >> Oh my, of course it should be... >> my @repeated = grep { /some regex here/ && ++$seen{$_} > N }

Re: What does "=<" means?

2011-12-30 Thread Igor Dovgiy
Oh my, of course it should be... my @repeated = grep { /some regex here/ && ++$seen{$_} > N } @source_array; ... to work properly. -- iD 2011/12/30 Igor Dovgiy > Hi Xi, > > You're looking only for 'p' letters, not D and O? Why? > > Anyway, generic solution will be something like... > > my %see

Re: What does "=<" means?

2011-12-30 Thread Igor Dovgiy
Hi Xi, You're looking only for 'p' letters, not D and O? Why? Anyway, generic solution will be something like... my %seen; my @repeated = grep { /some regex here/ && $seen{$_} > N } @source_array; ... where N is how many times the symbols should appear in the source array to be counted as dupl

Re: What does "=<" means?

2011-12-30 Thread Xi Chen
Yes, I agree the code looks strange. Do you have any idea to do this with a clear code? I mean to find two same letters, "p" in @a? Xi On Thu, Dec 29, 2011 at 10:17 PM, John W. Krahn wrote: > Xi Chen wrote: >> >> Hello everyone, >> >> I saw a code below to get two same letters "p" in @a. >> >> @

Re: What does "=<" means?

2011-12-29 Thread John W. Krahn
Xi Chen wrote: Hello everyone, I saw a code below to get two same letters "p" in @a. @a = qw (D D p O H p A O); foreach $b (@a){ $n =~ /$b/i; if($n>= 2){ $m = $b; } } But I don't know what does ">=" mean. Thank you! It means "greater than or equal to". The expression "$n >= 2" is

Re: What does "=<" means?

2011-12-29 Thread Chris Stinemetz
On Thu, Dec 29, 2011 at 9:26 PM, Xi Chen wrote: > Hello everyone, > > I saw a code below to get two same letters "p" in @a. > > @a = qw (D D p O H p A O); > foreach $b (@a){ > $n =~ /$b/i; > if($n >= 2){ >     $m = $b; >    } > } > > But I don't know what does ">=" mean. Thank you! > It is just g

What does "=<" means?

2011-12-29 Thread Xi Chen
Hello everyone, I saw a code below to get two same letters "p" in @a. @a = qw (D D p O H p A O); foreach $b (@a){ $n =~ /$b/i; if($n >= 2){ $m = $b; } } But I don't know what does ">=" mean. Thank you! Xi -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional command