Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the autobox-Core CPAN distribution.

Report information
The Basics
Id: 45421
Status: resolved
Priority: 0/
Queue: autobox-Core

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.6
Fixed in: (no value)



Subject: keys() and values() return an array ref?
$ perl -wle 'use autobox::Core; my %h = (a => 1, b => 2); print keys %h; print %h->keys' ab ARRAY(0x804a90) This contradicts an example in the docs. my $hashref = { foo => 10, bar => 20, baz => 30, qux => 40 }; print "hash keys: ", join ' ', $hashref->keys(), "\n"; I suppose it returns an array ref to allow chaining? %hash->keys->sort
On Sat Apr 25 06:47:56 2009, MSCHWERN wrote: Show quoted text
> $ perl -wle 'use autobox::Core; my %h = (a => 1, b => 2); print keys > %h; print %h->keys' > ab > ARRAY(0x804a90) > > This contradicts an example in the docs. > > my $hashref = { foo => 10, bar => 20, baz => 30, qux => 40 }; > print "hash keys: ", join ' ', $hashref->keys(), "\n"; > > I suppose it returns an array ref to allow chaining? > > %hash->keys->sort
keys() and values() indeed return ArrayRef. Updated documentation. Thanks! Update -- stuff uses wantarray but I may have missed places. Should be possible to chain or use results directly. Oh, by the way, I wasn't aware there *was* an RT and the default for these auto-created RT queues is not to email, so you filed a bug report straight to the bitbucket. Sorry for the confusion.
Blargh