On Friday 09 July 2004 08:14, Christopher J. Bottaro wrote: > > i want to remove items from a hash then later see if they exist using > defined(). for example: > > delete($hash{MYKEY}); > # blah blah > if (defined($hash{MYKEY})) { > # do blah blah > } > > which should i use? delete() or undef()? obviously i could write a > small script to test this (which i'm going to know), but i'd also > like to hear from an expert about the subtle (if any) difference > between the two if they both work.
This is a Frequently Asked Question which can be found in the perlfaq4 document. perldoc -q "What's the difference between \"delete\" and \"undef\" with hashes" John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>