in reply to set context for method's return values
you can also: print +(split /,/, 'A,B,C,D')[2]
where the + sign avoid the warning print (...) interpreted as function
> return value as an array ..
Technically using () we are creating a list, not an array: we can access the Nth element but, for example, we cannot push to it.
L*
PS the phrase about parens was related to this usage, not their general use; see below..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: set context for method's return values
by LanX (Saint) on Jan 25, 2022 at 10:20 UTC | |
by rsFalse (Chaplain) on Jan 29, 2022 at 11:59 UTC | |
|
Re^2: set context for method's return values
by demoralizer (Beadle) on Jan 25, 2022 at 15:25 UTC | |
by Fletch (Bishop) on Jan 25, 2022 at 15:40 UTC | |
by ikegami (Patriarch) on Jan 25, 2022 at 17:23 UTC | |
by BillKSmith (Monsignor) on Jan 26, 2022 at 14:16 UTC | |
by LanX (Saint) on Jan 25, 2022 at 16:36 UTC | |
by rsFalse (Chaplain) on Jan 29, 2022 at 11:47 UTC | |
by demoralizer (Beadle) on Feb 01, 2022 at 07:47 UTC |