In words: I want ARRAY to know that when I do $array->foo, where $array is an array ref and foo is an arbitrary method, it should magically do map { $_->foo } @$arraypackage Bar; use Moose; sub bar { print "bar\n"; } package Foo; use Moose; sub foo { return [(Bar->new)x3]; # what magic do i need to apply here? } package main; Foo->new->foo->bar; #should print "bar\nbar\nbar\n" instead of failing + with "Can't call method "bar" on unblessed reference"
In reply to how to create a "delegating" array? by holli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |