daverave has asked for the wisdom of the Perl Monks concerning the following question:

I'm using Eclipse combined with EPIC to write my Perl code. I configured EPIC to use Perltidy with "-pbp" (perl best practices) to format my code.

This doesn't work well when using Method::Signatures.

E.g., func (:$arg1, : $arg2) is formatted as func (: $arg1, : $arg2) which yields an error, and func keyword is not recognized like sub so indentation is also wrong.

Cross posted in SO.

Replies are listed 'Best First'.
Re: How can I make perltidy work with Method::Signatures?
by Anonymous Monk on Oct 09, 2010 at 11:58 UTC
    Either use the appropriate comment to signal to perltidy to not edit that line, or patch perltidy to work with Method::Signatures

    Or, avoid black magic altogether

Re: How can I make perltidy work with Method::Signatures?
by Anonymous Monk on Oct 11, 2010 at 11:06 UTC
    To go the comment route, take for example temp.pl modify temp.pl with
    perl -i.bak -pe"if(s/^(func|method)/#<<<\n$1/){ s/$/#>>>/ }" temp.pl
    and perltidy will leave those declarations alone, but it will complain
Re: How can I make perltidy work with Method::Signatures?
by swartz (Beadle) on Nov 24, 2010 at 01:59 UTC

    daverave - have you found a solution this? I'm facing exactly the same issue. I perltidy all my code on commit, but really want to use Method::Signatures::Simple.

    Facing the prospect of hacking perltidy, unless someone has already done this...

      Hi swartz,

      Unfortunately I haven't come up with a solution. I'll appreciate you dropping me a line if you make any progress.