You don't really need to change the function to use a reference based solution.
use Modern::Perl; sub givelist { return 'a' .. 'c'; } say [givelist()]->[1];
In reply to Re^2: [Solved] Pick a single item from a sub's return list
by mr_ron
in thread [Solved] Pick a single item from a sub's return list
by davies
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |