Ronen Kfir wrote:
>If I get you correctly the %supliers hash will look like this in this
>script:
>%supliers =(booboo =>'1',
> Puter =>'1',
> Synta => 'defined')
>.... or am I wrong. I need to see the real print of this hash in order to
>understand it...
>
Not exactly, all keys in %supliers are assigned the value '1', and are thereby
defined. Being defined is the same as having any value other than undef. So
%supliers{synta} gets '1' if the loop encounters the first user with the value "synta"
(in the %machines hash) and is thereby defined if the loop encounters the second user
with the value "synta". Then you get the duplicate message.
Note that the %supliers hash will start out empty, i.e. without key/value pairs. This
is a prerequisite for the duplicate check.
Apart from your actual problem, you should always use strict in your script to make
Perl enforce good programming style and use warnings (if you have a recent Perl
distribution) to make Perl tell you about hazardous operations.
HTH,
Jan
--
How many Microsoft engineers does it take to screw in a lightbulb? None. They just
redefine "dark" as the new standard.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>