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 ]

domm (4030)

  (email not shown publicly)

Just in case you like to know, I'm currently full-time father of 2 kids, half-time Perl hacker, sort-of DJ, bicyclist, no longer dreadlocked and 33 years old

I'm also head of [], maintainer of the CPANTS [] project, member of the TPF Grants Commitee [] and the YAPC Europe Foundation [].

I've got stuff on CPAN [], held various talks [] and organised YAPC::Europe 2007 in Vienna [].

Journal of domm (4030)

Tuesday June 09, 2009
02:28 PM

perltidy help needed

[ #39106 ]

As we all know, perltidy is a very cool and powerful tool, and I love it. But there's one thing I cannot get it to do, which is best explained as code...

I would like to get this as a result:

$self->do_something( $c, {
    rs              => $c->model('DB::Foo')->search( { bar => 'baz' } ),
    fluxcompensator => '1.21 jigowatts',

Specifically, I want the ( $c, { on the same line and the contents of the hash only indented on level deeper.

I played around with a lot of settings, but could only get this:

    $c, {
        rs              => $c->model('DB::Foo')->search( { bar => 'baz' } ),
        fluxcompensator => '1.21 jigowatts'



I also tried --line-up-parentheses like this (additional to the above options):


with this result:

$self->do_something( $c, {
                        rs =>
                            $c->model('DB::Foo')->search( { bar => 'baz' } ),
                        fluxcompensator => '1.21 jigowatts'
                     } );

Now the $c and { line up, but I do not like the fact that rs=> etc is indented that much.

So, dear lazyweb: What's the right perltidy setting? Or does perltidy simply not support my favourite coding style?

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.