Нет, это речь о самом keys, это само собой. А зачем _аргументу_ быть lvalue?
19.11.2013, 13:29, "Denis Ibaev" <[email protected]>: > 19 ноября 2013 г., 15:20 пользователь Oleg Alistratov <[email protected]> > написал: > >> выглядит так, будто для keys() требуется, чтобы аргумент был lvalue. >> lvalue из undef автовивифицируется, это факт. >> >> Непонятно мне только, зачем аргументу keys быть lvalue? > > Вероятно, за этим (perldoc -f keys): > > Used as an lvalue, "keys" allows you to increase the number of hash > buckets allocated for the given hash. This can gain you a measure of > efficiency if you know the hash is going to get big. (This is similar > to pre-extending an array by assigning a larger number to $#array.) > If you say > > keys %hash = 200; > > then %hash will have at least 200 buckets allocated for it--256 of > them, in fact, since it rounds up to the next power of two. > > -- > Денис Ибаев > -- > Moscow.pm mailing list > [email protected] | http://moscow.pm.org -- Oleg Alistratov -- Moscow.pm mailing list [email protected] | http://moscow.pm.org
