No such thing as a small change | |
PerlMonks |
Re: set context for method's return valuesby Discipulus (Canon) |
on Jan 25, 2022 at 08:26 UTC ( [id://11140839]=note: print w/replies, xml ) | Need Help?? |
Hello demoralizer, 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..
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|