in reply to Re: Returning two lists from a sub
in thread Returning two lists from a sub

Why do you need a return value? Is there a specific reason you can't do this? my (@a, @b); &get_lists; print join(" ",@a),"\n",join(" ",@b); sub get_lists{ my @a = (1,2,3); my @b = (4,5,6); }

Replies are listed 'Best First'.
Re^3: Returning two lists from a sub
by otto (Beadle) on Jun 07, 2007 at 18:03 UTC

    ...other than the fact that it does not work...

    Your my in the sub hides the "outer" @a and @b.

    I did mention your technique as (Ok a third way is via a out of bounds global thingy.)