Re: Unable to understanding map usage

2013-07-24 Thread *Shaji Kalidasan*
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. --

Re: Unable to understanding map usage

2013-07-24 Thread *Shaji Kalidasan*
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

Re: Unable to understanding map usage

2013-07-24 Thread Jim Gibson
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

Re: Unable to understanding map usage

2013-07-24 Thread Shawn H Corey
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

Re: Unable to understanding map usage

2013-07-24 Thread Jim Gibson
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 )

Unable to understanding map usage

2013-07-24 Thread Rajeev Kilaru
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