in reply to Help with strict
As for the other things within do_command and do_help that seem to be using $nick without any trouble, you should be aware that it's possible, grammatical, and no problem under "use strict", for a hash key to be an undefined value (although if you "use warnings" or include the "-w" flag, you will get run-time warnings about assigning to or referencing a hash element using an "undef" value as the hash key -- e.g. try the following test script, with and without the "-w" flag (or with and without "use warnings;"):
Obviously, if you repeatedly use an undef or empty hash key to store different values into a hash, subsequent values will replace previous ones.use strict; my %hash; my $key = undef; $hash{$key} = 3; print "A hash element with value $hash{$key} is stored with key=$key\n +";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Help with strict
by Nkuvu (Priest) on Oct 29, 2003 at 01:57 UTC |