Re: Search and Replace
- From: rob.dixon@xxxxxxx (Rob Dixon)
- Date: Sat, 14 Jul 2007 18:43:32 +0100
Chas Owens wrote:
On 7/14/07, Mr. Shawn H. Corey <shawnhcorey@xxxxxxxx> wrote:snip
Chas Owens wrote:
By the way, an easier way to write the join version is
print map { "$_\n" } @list;
BTW, that's not the same. Join inserts its string between each element,
map (in this case) appends it to the end. A subtle difference that may
lead to confusion and errors.
The code I am referring to is
print +(join "\n", @LIST), "\n" ;
Which does the same thing as
print map { "$_\n" } @list;
The only difference between them is if $, is set.
No it doesn't. As Shawn said, the join doesn't append a newline
after the last element.
Rob
.
- Follow-Ups:
- Re: Search and Replace
- From: Chas Owens
- Re: Search and Replace
- From: Rob Dixon
- Re: Search and Replace
- References:
- Search and Replace
- From: Joseph L. Casale
- Re: Search and Replace
- From: Chas Owens
- Re: Search and Replace
- From: Rob Dixon
- Re: Search and Replace
- From: Chas Owens
- Re: Search and Replace
- From: Dr.Ruud
- Re: Search and Replace
- From: Chas Owens
- Re: Search and Replace
- From: Mr. Shawn H. Corey
- Re: Search and Replace
- From: Chas Owens
- Search and Replace
- Prev by Date: Re: Search and Replace
- Next by Date: Re: Search and Replace
- Previous by thread: Re: Search and Replace
- Next by thread: Re: Search and Replace
- Index(es):
Relevant Pages
|