ot;,"mangoes"
[/code]
[output]
"'apples'","oranges","'guavas'","cherri'es","mangoes"
[/output]
best,
Shaji
---------------
Your talent is God's gift to you. What you do with it is your gift back to God.
--
d's gift to you. What you do with it is your gift back to God.
---
From: Rajeev Kilaru
To: beginners@perl.org
Sent: Thursday, 25 July 2013 12:14 AM
Subject: Unable to understanding map usage
On Jul 24, 2013, at 12:33 PM, Shawn H Corey wrote:
> On Wed, 24 Jul 2013 12:25:16 -0700
> Jim Gibson wrote:
>
>> In your case, BLOCK is
>>
>> { $_=~ s/\"/\'/g; "\"$_\"" }
>>
>> and LIST is @data. Therefore, each element of @data is aliased to $_,
>> the substitution s//\"/\'/g is performed
On Wed, 24 Jul 2013 12:25:16 -0700
Jim Gibson wrote:
> In your case, BLOCK is
>
> { $_=~ s/\"/\'/g; "\"$_\"" }
>
> and LIST is @data. Therefore, each element of @data is aliased to $_,
> the substitution s//\"/\'/g is performed on it, which changes all
> double-quote characters to single-qu
On Jul 24, 2013, at 11:44 AM, Rajeev Kilaru wrote:
> Hello,
>
> I am looking at the following code someone wrote and I have
> difficultly in understand map usage. Can somebody please explain how
> does the following code work?
>
> print OUT2 join( ',', map { $_=~ s/\"/\'/g; "\"$_\"" } @data )
Hello,
I am looking at the following code someone wrote and I have
difficultly in understand map usage. Can somebody please explain how
does the following code work?
print OUT2 join( ',', map { $_=~ s/\"/\'/g; "\"$_\"" } @data )
Thanks,
Rajeev Kilaru
--
To unsubscribe, e-mail: beginners-unsub