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

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]); }

Replies are listed 'Best First'.
Re^4: setting values inside subroutine
by Anonymous Monk on Sep 28, 2015 at 06:43 UTC
    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] ); }