in reply to Returning arrays from subroutines

Your mask subroutine is basically returning a copy of @base which is then assigned to @net. The technique has some performance issues, but should work fine as long as you only need to return a single list. Things get slightly more complicated when later you find that you need to return some other values from mask.

Replies are listed 'Best First'.
Re^2: Returning arrays from subroutines
by cbrandtbuffalo (Deacon) on Jun 17, 2005 at 00:54 UTC
    And when you get to that point, you'll want to look into passing and returning references rather than the actual arrays. References are scalars that know where an array lives so you can pass a single scalar back and forth, but still access the elements. Check the [id://Tutorials] for some more info (among other places).