Slash Boxes
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

use Perl Log In

Log In

[ Create a new account ]

jk2addict (4946)

  (email not shown publicly)
AOL IM: chrislaco (Add Buddy, Send Message)
Yahoo! ID: (Add User, Send Message)

Journal of jk2addict (4946)

Monday January 21, 2008
03:23 PM

My Perl 5.12 Wishlist

[ #35444 ]
It's one thing and one thing only. Unless my memory is wrong, sub attributes can only be on the first line. Please o please, allow them to span multiple lines. When using Catalyst, you could start with this:

sub update : Chained('instance') PathPart Args(0)

The minute you start adding custom attributes, things end up well past 70-80 columns wide:

sub update : Chained('instance') PathPart Args(0) Form('someform.yml') Template('this/page') ActionClass('REST')

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I have wanted that for a long time.

  • Is this a Catalyst-specific restriction?
    Running the following code under perl 5.8.8 seems to work fine.

    use strict;
    use warnings;

            shift; shift;

            print "Got attributes:\n";
            print "\t$_\n" for @_;

            return ();

    sub foo
            : Chained('instance')
            : PathPart
            : Args(0)
            : Form
  • I've just tried changing one of my action declarations to this:

    sub index
            : Path('')
            : Form
            # ...

    in a Cat app running under perl 5.8.8 and Catalyst 5.7011

    And both attributes seem to still work as expected, so what are you talking about, man?!? ;)
    • Hey, when chromatic says "I have wanted that for a long time."...I'm not just making this up. I swear I'm not. :-)

      Scouring deltas/changes so far yields nothing. Maybe it was an urban myth that they couldn't be on multiple lines, or maybe it was fixed and no one logged it for us mere mortals. :-)
      • hmm, yesterday's message on the catalyst mailing list - asking why :Private actions aren't allowed any other attributes (something I'd forgotten) - makes me wonder whether someone once combined :Private with another attribute after a newline, then by the time they'd worked round it, got confused as to what had happened - and behold: the FUD was born...