[Catalyst] Problem flattening arrays in
Catalyst/Helper/Model/DBIC/Schema
pablo marin-garcia
harpactocrates at googlemail.com
Fri Aug 28 21:56:30 GMT 2009
On Fri, Aug 28, 2009 at 6:26 PM, Tomas Doran<bobtfish at bobtfish.net> wrote:
>
> On 28 Aug 2009, at 18:11, pablo marin-garcia wrote:
>> Am I in the right path of reasoning or I have missed something? I am
>> new to all this 'perl6' magic like autobox implementation and 'modern
>> perl'.
>
> Please stop making up random names for shit cause you don't understand it.
> You did it with 'Moose Arrays', and you're now doing it with 'perl6 magic'.
>
> Otherwise I will be referring to everything as vroomfondle from now on.
You are rigth, sorry about that. I was mentioning perl6 because the
autobox::Core docs (but probably this does not apply here, sorry)
======
Some things expected in Perl 6, such as last, elems, and curry, have
been thrown in. For use in conjuction with Perl6::Contexts, flatten
explicitly flattens an array. Functions have been defined for numeric
operations.
======
>
> works... This is why I was confused about why the Moose::Autobox tests
> didn't fail...
Well this is the crazy thing:
/usr/bin/perl "-Iinc" "-MModule::Install::ExtraTests" "-e"
"Module::Install::ExtraTests::__harness('Test::Harness', 0, '',
'xt/release', '', 0, 'blib/lib', 'blib/arch')" t/*.t
t/000_load.t ............... ok
t/001_basic.t .............. ok
t/002_role_hierarchy.t ..... ok
t/003_p6_example.t ......... ok
t/004_list_compressions.t .. ok
t/005_string.t ............. ok
t/006_y_combinator.t ....... ok
t/007_base.t ............... ok
t/008_flatten.t ............ ok
All tests successful.
Files=9, Tests=156, 6 wallclock secs ( 0.13 usr 0.03 sys + 4.98
cusr 0.38 csys = 5.52 CPU)
Result: PASS
RJBS/Moose-Autobox-0.09.tar.gz
/usr/bin/make test -- OK
>> pg4 at deskpro17122[~/.cpan/build/autobox-2.55-RKhwNV]226
>> $ perl t/flatten.t
>
> Right, so it fails with your installed version...
>
> Try perl -Ilib t/flatten.t and it'll work I guess
No, it does not.
$ perl -llib t/flatten.t
$VAR1 = undef;
not ok 1 - autobox ->to test
# Failed test 'autobox ->to test'
# at t/flatten.t line 16.
# got: undef
# expected: '10_to_1'
# Can't call method "to" without a package or object reference at
t/flatten.t line 14.
not ok 2 - testing autobox flatten
# Failed test 'testing autobox flatten'
# at t/flatten.t line 20.
# Structures begin differing at:
# $got->[0] = '2'
# $expected->[0] = ARRAY(0x81f8888)
# Can't call method "flatten" on unblessed reference at t/flatten.t line 19.
Can't locate object method "to_upper" via package "hello" (perhaps you
forgot to load "hello"?) at t/flatten.t line 23.
# Tests were run but no plan was declared and done_testing() was not seen.
But as every cloud has a silver lining, I will take this chance to
update finally to perl 5.10
FINALLY IT WORKS!
I have updated my PERL5LIB to a new local_lib and the good parts is
that Moose already intalled in my system for perl 5.10 so I don't
even need to install it.
$ perl_5.10 flatten.t
$VAR1 = '10_to_1';
ok 1 - autobox ->to test
ok 2 - testing autobox flatten
ok 3 - autobox is enabled
# Tests were run but no plan was declared and done_testing() was not seen.
Definitively there was something wrong with my conf in old perl. But
it is not worthy to explore any longer this can of worms. I am not
able to use catalyst with my new perl ;-).
Now I am installing Catalyst again in the perl_5-10 and facing new problems
Should I install this module? [Y/n]:
gpg: Signature made Sun May 31 11:43:05 2009 BST using DSA key ID 96509C21
gpg: Can't check signature: public key not found
[ERROR] Signature check failed for module 'CGI::Simple::Cookie' -- Not
trusting this module, aborting install
But this would be another story and I would ask my sysadmin to fight
this battle.
Thanks a million for your help Tom.
--
- Pablo Marin-Garcia
More information about the Catalyst
mailing list