Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Why is print output different for function returning an array versus printing an array variable?by BrowserUk (Patriarch) |
on Oct 10, 2014 at 11:11 UTC ( [id://1103394]=note: print w/replies, xml ) | Need Help?? |
Because: print sort(@coins); Uses $, (also known as $OUTPUT_FIELD_SEPARATOR (default value ' ' (space)) to separate items printed from a list. (The list returned by sort.) Whereas: print "@coins"; Forces the array to be concatenated into a single string using $", (also known as $LIST_SEPARATOR, default value '' (null)). Hence the former has spaces, but the latter has none. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|