in reply to Why is print output different for function returning an array versus printing an array variable?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is print output different for function returning an array versus printing an array variable?
by Anonymous Monk on Oct 10, 2014 at 16:11 UTC | |
|
Re^2: Why is print output different for function returning an array versus printing an array variable?
by aixtools (Novice) on Nov 06, 2014 at 14:00 UTC | |
by aixtools (Novice) on Nov 06, 2014 at 14:07 UTC |