> "R" == Ruud writes:
R> On 2011-01-12 18:08, Uri Guttman wrote:
>> Ruud writes:
>>> On 2011-01-11 11:44, Uri Guttman wrote:
these are equivilent:
my @out = grep /foo/, @in ;
my @out = map { /foo/ ? $_ : () } @in ;
>>>
>>> Indeed equivalent. There is
On 2011-01-12 18:08, Uri Guttman wrote:
Ruud writes:
On 2011-01-11 11:44, Uri Guttman wrote:
these are equivilent:
my @out = grep /foo/, @in ;
my @out = map { /foo/ ? $_ : () } @in ;
Indeed equivalent. There is a difference though
in what comes out of map and grep:
perl -wle'
On 12/01/2011 17:51, shawn wilson wrote:
On Jan 12, 2011 12:10 PM, "Uri Guttman" wrote:
"R" == Ruud>
writes:
R> On 2011-01-11 11:44, Uri Guttman wrote:
>> these are equivilent:
>>
>> my @out = grep /foo/, @in ;
>> my @out = map { /foo/ ? $_ : () } @in ;
R> Indeed equivale
On Jan 12, 2011 12:10 PM, "Uri Guttman" wrote:
>
> > "R" == Ruud >
writes:
>
> R> On 2011-01-11 11:44, Uri Guttman wrote:
> >> these are equivilent:
> >>
> >> my @out = grep /foo/, @in ;
> >> my @out = map { /foo/ ? $_ : () } @in ;
>
> R> Indeed equivalent. There is a difference though
> "R" == Ruud writes:
R> On 2011-01-11 11:44, Uri Guttman wrote:
>> these are equivilent:
>>
>> my @out = grep /foo/, @in ;
>> my @out = map { /foo/ ? $_ : () } @in ;
R> Indeed equivalent. There is a difference though
R> in what comes out of map and grep:
R> perl -wle'
R
On 2011-01-11 11:44, Uri Guttman wrote:
these are equivilent:
my @out = grep /foo/, @in ;
my @out = map { /foo/ ? $_ : () } @in ;
Indeed equivalent. There is a difference though
in what comes out of map and grep:
perl -wle'
my @in = 1 .. 4;
print "@in";
++$_ for
Rob, I'm going to answer the middle part of your mail first, hopefully you
won't mind:
> On Tue, Jan 11, 2011 at 3:56 PM, Rob Dixon wrote:
> The link you supply talks about recent versions of push, pop, etc.
> working on array references as well as arrays, so that the code could
> also be writt
On 11/01/2011 14:30, Brian Fraser wrote:
On Tue, Jan 11, 2011 at 10:19 AM, John W. Krahn wrote:
foreach (@arr) {
push @new, $_;
}
Trying to use a scalar as the first argument to push will result in an
error message.
Doesn't make the original any less wrong, but as an aside, that's no lo
On Tue, Jan 11, 2011 at 10:19 AM, John W. Krahn wrote:
> foreach (@arr) {
> push @new, $_;
> }
>
> Trying to use a scalar as the first argument to push will result in an
> error message.
>
>
Doesn't make the original any less wrong, but as an aside, that's no longer
true on 5.13.7+ Perls. http:/
shawn wilson wrote:
On Tue, Jan 11, 2011 at 4:57 AM, Sean Murphy wrote:
Hi all.
I have read the explaination of the Map function and it is still a mystry to
myself on what it is for and when would you use it?
All explainations I have seen in books and blogs don't make it clear.
my @new = m
>> that is a poor explanation IMO.
hell, i was going to give this which dereferences the reference of a
reference DBI's selectall_arrayref returns so that i can later loop
through it again and again with different parameters:
my (@groups) = map {...@$_} @{ $dbh->selectall_arrayref("select distinc
-
From: "Uri Guttman"
To: "shawn wilson"
Cc: "Sean Murphy" ;
Sent: Tuesday, January 11, 2011 9:44 PM
Subject: Re: Map function, what does it do?
"sw" == shawn wilson writes:
sw> On Tue, Jan 11, 2011 at 4:57 AM, Sean Murphy
wrote:
>> Hi
> "sw" == shawn wilson writes:
sw> On Tue, Jan 11, 2011 at 4:57 AM, Sean Murphy wrote:
>> Hi all.
>>
>> I have read the explaination of the Map function and it is still a mystry
to
>> myself on what it is for and when would you use it?
>>
>> All explainations I have seen in
On Tue, Jan 11, 2011 at 4:57 AM, Sean Murphy wrote:
> Hi all.
>
> I have read the explaination of the Map function and it is still a mystry to
> myself on what it is for and when would you use it?
>
> All explainations I have seen in books and blogs don't make it clear.
>
my @new = map {$_} @arr;
Hi all.
I have read the explaination of the Map function and it is still a mystry to
myself on what it is for and when would you use it?
All explainations I have seen in books and blogs don't make it clear.
Sean
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional comm
15 matches
Mail list logo