in reply to ref 'n typeglob

You attempted to solve this wrong two ways and missed the one "right" way. First - my() variables are not accessible via the symbol table and so typeglobs have no place in this discussion. Second - you don't need the prototype because - Third - @_'s elements are aliased to the actual variables.

In mysub tie the $_[0] variable directly. Don't shift it, don't pop it - you have to access it right inside the array.

Replies are listed 'Best First'.
Re: Re: ref 'n typeglob
by Pardus (Pilgrim) on Apr 01, 2003 at 01:14 UTC
    I knew there was something twisted in my mind ... *sigh*
    --
    Jaap Karssenberg || Pardus (Larus)? <pardus@cpan.org>
    >>>> Zoidberg: So many memories, so many strange fluids gushing out of patients' bodies.... <<<<

      Just as a light warning... diotalevi's method works fine but be aware that if you ever call my_sub("literal") (or similar), you will end up with a fatal error of Modification of a read-only value attempted at ... (with the file and line number being in your package at the tie; you may want to trap that error and carp it out to the caller).

      bbfu
      Black flowers blossom
      Fearless on my breath