in reply to Using pseudohash for argument list validation

It is experimental, and you ought to drop a line to the perl devel mailing list (or Dominus) for info about the future. Experimental things do actually go away sometimes.

Also, I'd like to point you to ArrayHashMonster from the M.J.Dominus ( http://perl.plover.com) which says ( in README)

It's alive! It's Aliiiive! Is it an array, or is it a hash? Neither! Both! It's a disgusting frankenstein's monster made by sewing together bits and pieces of arrays and hashes into a monstrous and unholy creation! What does it do? It manufactures an object that can be used as either an array reference or a hash reference. Why would you ever want such a thing? Well, it's the natural way to present an ordered hash. You could then use $orderedhash->[7] to get item number seven, or $orderedhash->{key} to get the item with the specified key. Or for example you could have an object that represents a directory. $dir->[3] gets the name of file number 3 from the directory, so it is easy to iterate over the files in the directory, and $dir->{name} gets the stat information for the file named `$name'. The test.pl file has a demonstration of how to do this. Discovery of how this works is left as an exercise for the reader.

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

  • Comment on (crazyinsomniac) Re: Using pseudohash for argument list validation
  • Download Code