print map question

2010-11-13 Thread Mike McClain
mike@/deb40a:~/perl> perl -v This is perl, v5.8.8 built for i486-linux-gnu-thread-multi mike@/deb40a:~/perl> perl -we ' @list=qw/Perl is cool./;print( "list=\t", map { "$_," } @list, "\n"); ' list= Perl,is,cool., ,mike@/deb40a:~/perl> Could someone tell me why there is a comma printed after the

Re: print map question

2010-11-13 Thread Uri Guttman
> "MM" == Mike McClain writes: MM> mike@/deb40a:~/perl> perl -we ' MM> @list=qw/Perl is cool./;print( "list=\t", map { "$_," } @list, "\n"); MM> ' MM> list= Perl,is,cool., MM> ,mike@/deb40a:~/perl> MM> Could someone tell me why there is a comma printed after the newline? becau

Re: print map question

2010-11-14 Thread Mike McClain
On Sat, Nov 13, 2010 at 05:43:21AM -0500, Uri Guttman wrote: > > "MM" == Mike McClain writes: > MM> Could someone tell me why there is a comma printed after the newline? > because you put it there. the \n is input to the map, not the print! > map's last arg is a list and it takes @list AND