in reply to Create a reference in a sub and pass it back?

If you want to modify arguments passed to a subroutine you have to assign to $_[1] or so directly.

However in many cases this is considered rather bad style, and needs to be documented very well.

If you have the option, consider returning a data structure from the subroutine instead.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Create a reference in a sub and pass it back?
by Tharg (Scribe) on Sep 16, 2009 at 12:06 UTC

    Many thanks, works perfectly.