http://qs321.pair.com?node_id=30766


in reply to (Guildenstern ) REx4: Win32::MemoryInfo
in thread Win32::MemoryInfo

Silly trick:
my %args = %default, @_; foreach my $arg (keys %args) { unless (exists $allowed{$arg}) { croak("Unrecognized argument '$arg' passed to MemoryStatus."); } }
Just put all possible defaults in %default and the user can override any combination they want, and your %allowed check will catch most typos and misunderstandings of the API.