My Perl 5.12 Wishlist

jk2addict on 2008-01-21T20:23:09

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')


Seconded

chromatic on 2008-01-21T23:10:45

I have wanted that for a long time.

it seems to work with 5.8.8

fireartist on 2008-01-22T10:55:35

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

use strict;
use warnings;

sub MODIFY_CODE_ATTRIBUTES {
        shift; shift;

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

        return ();
}

sub foo
        : Chained('instance')
        : PathPart
        : Args(0)
        : Form('someform.yml')
        : Template('this/page')
        : ActionClass('REST')
{
        print "ok\n";
}

foo();

###

outputs:

$ perl test.pl
Got attributes:
                Chained('instance')
                PathPart
                Args(0)
                Form('someform.yml')
                Template('this/page')
                ActionClass('REST')
ok

works in catalyst too

fireartist on 2008-01-22T11:10:12

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?!? ;)

Re:works in catalyst too

jk2addict on 2008-01-22T14:13:17

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. :-)

Re:works in catalyst too

fireartist on 2008-01-23T10:04:37

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...