I assume that you want to be sure that %seen is an empty hash, not that the scalar $seen is set to be undef.
Using strict catches this common typo.
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
Hashes start off empty. But if you put your code into a subroutine and call it twice, the second time around it will still be populated from the first.
Incidentally I'm willing to bet, sight unseen, that the actual code in the cookbook got this right. :-P
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)