in reply to Simple Array
If your hash is declared as a my() variable inside a block during entry, you can even have the memory freed when you leave the block.while(<STDIN>){ push @array, $_; if($hash{$_}){ print "$_ was entered more than once\n"; } $hash{$_}++; }
|
|---|