http://www.perlmonks.org?node_id=1015790


in reply to how to use "delete" with a hash of hash

Hello brassbin,

smls++ has answered your question, but it occurs to me: if you don’t have a variable named $item2, either use strict or use warnings would have shown the error. With warnings:

Name "main::item2" used only once: possible typo at...

and with strict:

Global symbol "$item2" requires explicit package name at...

Moral: Always begin each script with:

use strict; use warnings;

It’s often useful to have:

use diagnostics;

as well, to clarify any warnings or error messages.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,