In the previous post I actually wanted to show an error message that was hard for me to understand at first. It was suppose to be a tidbit but I was too excited about Moose so I forgot all about it and wrote about my Roles usage attempt.
sawyer@gnubuntu:~/some/unknown/folder$ perl eg.pl String found where operator expected at Whatever.pm line 27, near "croak "Couldn't construct template: $Text::Template::ERROR\n"" (Do you need to predeclare croak?) String found where operator expected at Whatever.pm line 32, near "croak "Couldn't fill in template: $Text::Template::ERROR\n"" (Do you need to predeclare croak?) Could not load class (Whatever) because : syntax error at Whatever.pm line 27, near "croak "Couldn't construct template: $Text::Template::ERROR\n"" syntax error at Whatever.pm line 32, near "croak "Couldn't fill in template: $Text::Template::ERROR\n"" Compilation failed in require at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 151. at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 133 Class::MOP::load_first_existing_class('Whatever') called at /usr/local/lib/perl/5.8.8/Class/MOP.pm line 157 Class::MOP::load_class('Whatever') called at /usr/local/share/perl/5.8.8/Moose/Util.pm line 83 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0x8745734)', 'Whatever') called at /usr/local/share/perl/5.8.8/Moose.pm line 70 Moose::with('Whatever::Internal', 'Whatever') called at /usr/local/share/perl/5.8.8/Moose/Exporter.pm line 201 Moose::with('Whatever') called at Whatever/Internal.pm line 3 require Whatever/Internal.pm called at eg.pl line 9 main::BEGIN() called at Whatever/Internal.pm line 0 eval {...} called at Whatever/Internal.pm line 0 Compilation failed in require at eg.pl line 9. BEGIN failed--compilation aborted at eg.pl line 9.This was so simple it hurt that it took me a few minutes of going back and forth between the error message and the code to see what's wrong. I imagine that if I used diagnostics, it would be much bigger.