On Sep 23, Ryan Frantz said:

From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]

foreach my $process (in $sobj->InstancesOf("Win32_LogicalDisk")) {
  next if $ignoreDriveTypes{ $process->{DriveType} };

So this would evaluate to true if $process->{DriveType} matches a key in
the hash?

It would evaluate to whatever $ignoreDriveTypes{$process->{DriveType}} is. If $process->{DriveType} is a key of %ignoreDriveTypes, it'd be whatever that key's value is. Otherwise, it returns undef (false).

If, by some bizarre coincidence, 0, '', or undef would be a valid value for the key's value in the hash, you would need to use

  next if exists $ignoreDriveTypes{ $process->{DriveType} };

which ignores the actual contents of the key's value, and just checks to see if the key is in the hash.

--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to