sneaky has asked for the wisdom of the Perl Monks concerning the following question:
I do not understand what is happening here. In my mind these should behave the opposite. I have also tried:print "Test 4:\n"; print join("\n", (("hello") x 5)), "\n\n"; print "Test 5:\n"; print join("\n", ("hello" x 5)), "\n\n"; >> Test 4: hello hello hello hello hello Test 5: hellohellohellohellohello
So can someone please help me understand the difference in the join operations above?print ("hello" x 5); print "\n"; print (("hello") x 5); >> hellohellohellohellohello hellohellohellohellohello
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Join with x operator
by hippo (Archbishop) on Jul 09, 2014 at 09:10 UTC | |
|
Re: Join with x operator
by johngg (Canon) on Jul 09, 2014 at 09:13 UTC | |
|
Re: Join with x operator
by thanos1983 (Parson) on Jul 09, 2014 at 15:16 UTC | |
|
Re: Join with x operator
by AnomalousMonk (Archbishop) on Jul 09, 2014 at 13:44 UTC | |
|
Re: Join with x operator
by sneaky (Initiate) on Jul 09, 2014 at 10:41 UTC |