Hi,

Documentation says it is available in PERL 5. 22.

http://perldoc.perl.org/Hash/Util.html

Is it a documentation mistake?

Tamas

-----Ursprüngliche Nachricht-----
Von: Kent Fredric [mailto:kentfred...@gmail.com] 
Gesendet: Mittwoch, 8. Juli 2015 13:00
An: Nagy Tamas (TVI-GmbH)
Cc: beginners@perl.org
Betreff: Re: using hash_value from Hash::Util

On 8 July 2015 at 21:51, Nagy Tamas (TVI-GmbH) <tamas.n...@tvi-gmbh.de> wrote:
>
>
> "hash_value" is not exported by the Hash::Util module
>
> "bucket_stats" is not exported by the Hash::Util module
>
> "bucket_info" is not exported by the Hash::Util module
>
> "bucket_array" is not exported by the Hash::Util module
>
> "lock_hash_recurse" is not exported by the Hash::Util module
>
> "unlock_hash_recurse" is not exported by the Hash::Util module
>
> "hash_traversal_mask" is not exported by the Hash::Util module
>
> Can't continue after import errors at t2tot3Project line 10
>
> BEGIN failed--compilation aborted at t2tot3Project line 29.
>
>
>
> What is this, and what is the qw after the use?


Most likely explanation: Your code was written for Perl >5.18, where those 
functions were available, but you're running it on a perl before <5.18, where 
those functions don't exist yet.

"qw" is a quote operator for lists of words.

For instance:

   my (@array) =  qw( hello world );

Has the same effect as if you'd written:

    my (@array) = split " ", q[ hello world ];

or

    my (@array) = split " ", "hello world";

or

    my (@array) = ('hello', 'world');

Obviously it is much easier to write than the last example, and is impervious 
to accidentally typing trailing spaces inside the quotes:

    my (@array) = ('hello', 'world '); # Hope you see the space!




--
Kent

KENTNL - https://metacpan.org/author/KENTNL

Reply via email to