Do you know where your variables are? | |
PerlMonks |
Class::C3::Adopt::NEXT warning on deprecated NEXTby bv (Friar) |
on Jan 08, 2010 at 22:16 UTC ( [id://816410]=perlquestion: print w/replies, xml ) | Need Help?? |
bv has asked for the wisdom of the Perl Monks concerning the following question: Hoping someone can straighten me out. I'm trying to do this the right way, so if there's a better way, I'd love to hear it. I wrote a Model for my Catalyst app that just loads a YAML file and provides accessors and validation. I copied some code from Catalyst::Model::DBI, specifically the code for new, but I'm getting warnings about my use of NEXT.
The error I get is this:
I read the documentation, and tried to follow it (hence the use MRO::Compat above). It says, You add use MRO::Compat to the top of a package as you start converting it, and gradually replace your calls to NEXT::method() with maybe::next::method(), and calls to NEXT::ACTUAL::method() with next::method(). but when I change my code to my $self = $class->maybe::next::new(@_); I get this error: Couldn't load class (Clio) because: Couldn't instantiate component "Clio::Model::YAML", "Can't locate object method "new" via package "maybe::next" at /home/miller/actions/note_taker/Clio/script/../lib/Clio/Model/YAML.pm line 16."Compilation failed in require at /usr/local/lib/perl/5.10.1/Class/MOP.pm line 98.Am I reading this wrong? How am I supposed to do this under C3? Thanks for any help you can give. UPDATE: Solved the problem. Short version: should be literally $class->maybe::next::method(@_). See my response below for details. print map{substr'hark, suPerJacent other l',$_,1}(11,7,6,16,5,1,15,18..23,8..10,24,17,0,12,13,3,14,2,4);
Back to
Seekers of Perl Wisdom
|
|