[Catalyst] Problem flattening arrays in
bobtfish at bobtfish.net
Thu Aug 27 22:45:05 GMT 2009
On 27 Aug 2009, at 21:52, pablo marin-garcia wrote:
>> When you said perl
>> 5.8, could you be a little more specific please?
> This is perl, v5.8.8 built for i686-linux-thread-multi
>> Like which version of perl 5.8, what your perl -V says, which
>> versions of
>> Moose, Moose::Autobox and autobox you have would be helpful details..
> cpan> m /Autobox/
Those are versions in your CPAN index, not the versions you have
perl -MMoose\ 999
perl -Mautobox\ 999
perl -MMoose::Autobox\ 999
>> FYI, there is no such thing as a 'Moose array', can you explain
>> what you
>> mean here? Also ->flatten as a method call is what Moose::Autobox
>> gives you
>> (a set of methods you can call on native data types)..
> When I was saying Moose array I was meaning the ArrayRef constraint
> isa => ArrayRef
> I have no experience with Moose, but I was assuming that or Moose
> bless the array to be able to call methods, or there is an operator
> overloading changing the meaning of the '->'. But anyway, I just
> started with Moose and still don't know how it operates its magic.
Nono, that isn't a Moose feature at all..
It's the use of Moose::Autobox which allows you to lexically call
stuff... So for example:
my @list = 2->flatten;
my @other_list = [ 2 ]->flatten;
is_deeply \@list, \@other_list;
>> I'm just not seeing how Moose::Autobox can pass it's tests for you
>> involve ->flatten working), but fail when run for real..
> This is the thing that puzzled me. Probably I have installed an unused
> dependency in the past with force and now is hitting me back.
Or possibly something else in the stack has changed. If you get the
version numbers (as above), then try to re-install Moose::Autobox from
CPAN, what happens? (I.e. do the tests pass)
More information about the Catalyst