in reply to return a ref to a return value (array) of another sub
\&x() evaluates, like \(1, 2, 3) does, to a list of references to the values in the original list: (\1, \2, \3). See perlref.
You can construct an anonymous array and have your second function (I'll call it "yy") return a reference to that:
sub yy { [ x() ] }
(Avoid "&" except when you really need it.)
|
|---|