in reply to Re: setting values inside subroutine
in thread setting values inside subroutine

yes, just try it ... no need to expand into @r its easy to  $r_ref->[0]

Replies are listed 'Best First'.
Re^3: setting values inside subroutine
by Anonymous Monk on Sep 28, 2015 at 05:39 UTC

    I called sample from my own sub like this, with the intention of accessing 0th element of @r defined in sample.Its not working. Can you let me know, what is missing here

    sub temp { sample(($t,$r_ref) = @_ ; $r_ref->[0]); }
      I dont know what you're trying to do , maybe this but its hard to tell
      sub temp { my( $t, $r_ref ) = @_; sample( $r_ref->[0] ); }