in reply to Can I get the name of a variable passed to a subroutine?

I think you should be able to call dBug_showArray with a hash.

dBug_showArray({my_array_reference=>\@my_array});
Inside dBug_showArray you may use either keys or each to get at it.
You may even send several arrays (by reference) to your debug routine.

Replies are listed 'Best First'.
Re: Re: Can I get the name of a variable passed to a subroutine?
by IlyaM (Parson) on Nov 30, 2001 at 23:27 UTC
    And does it help? You don't get string '@my_array' into this subroutine so it can't be printed. Or do you suggest to pass name of array variable as key? It is almost same as passing it as first argument as I suggested in my post.

    --
    Ilya Martynov (http://martynov.org/)

      "Or do you suggest to pass name of array variable as key?"

      That was my intention, yes. And that was what I tried to demonstrate in my little example. It may not have been crystal clear, though.

      "It is almost same as passing it as first argument as I suggested..."

      Almost the same is not the same. TIMTOWTDI.

      It wasn't my intention to step on your toes. Sorry if you feel it that way.

      f--k the world!!!!
      /dev/world has reached maximal mount count, check forced.