Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undef AoHoA

Status
Not open for further replies.

CJason

Programmer
Oct 13, 2004
223
US
How do you "undefine" an Array of Hashes of Arrays? It must not be as simple as:
Code:
undef @AoHoA;
because, I can't seem to get that do work?

I have @AoHoA that is filled. I want to clear that structure out completely...so that the test (for example):
Code:
if (defined($AoHoA[0]))
fails. That is, it's NOT defined (but, it was before I "undef" it).

Thanks in advance!
 
It turns out this is something a little more complex. I'm sending this AoHoA to a subroutine in a .pm file. It seems that once the AoHoA is set in the .pm, it doesn't ever get undef'ed...even when I undef the AoHoA being passed into the subroutine? Any ideas? If this isn't clear, please let me know and I'll try to explain better...
 
You are likely not [tt]use[/tt]ing [tt]strict[/tt] (as I do most of the time [blush]): when you pass the array to the subroutine it comes back into existence. Anyway those behaviors are quite difficult to interpret them fully.
For your problem just do
[tt]@AoHoA=();[/tt]
and the full structure will be cleared.

Franco
: Online engineering calculations
: Magnetic brakes for fun rides
: Air bearing pads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top