Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I wasn't aware that the extends needs to be in a BEGIN block unless you really do have code which needs to happen at BEGIN time. Am I wrong? (Could be).

    Also, with accepts a list and using multiple with statements should be avoided unless you have a very, very good reason to do so. A single with statement is like this:

    with qw(Does::Role1 DoesRole2);

    Using it like that gets you the method conflict resolution. Using separate with statements is not only overly verbose, but it composes each role in separate

    • I wasn't aware that the extends needs to be in a BEGIN block unless you really do have code which needs to happen at BEGIN time. Am I wrong? (Could be).

      You're not wrong. Extending the parent class needs to happen at compile time in Catalyst because as dagolden mentions elsewhere Catalyst choose once upon a time to support sub foo : Path(/) { } syntax. The nature of that syntax and how Perl goes about making it "work" requires your class hierarchy to be resolved at compile time ... hence the BEGIN.