>>>>> "JF" == Jeremiah Foster <jerem...@jeremiahfoster.com> writes:

  JF>   # autovivfy a hash with versions of packages 
  JF>         $versions{$package} = [ ] unless exists $versions{$package};      

that is MANUALLY vivifying an array. if you just pushed to the slot with
a dereference, that would be autovivifying. only perl can autovivify for
you! 

read this to learn more about autovivifying:

        http://sysarch.com/Perl/autoviv.txt

  JF>   Is this an efficient way to do this? Am I using the idiom
  JF>   correctly? Could I make it more readable? Is my predilection for
  JF>   map over foreach making this less readable? Or is that only a
  JF>   question of style?

map in a void context is considered poor coding style. it doesn't have
the storage penalty it used to have but its purpose is still to generate
a list. in a void context it can't do that so you are misleading the
reader. use foreach modifier for this instead.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to