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.
  • Perl::Tidy is your friend! :)

    I don't manually format any code any more.

    • And you can make it do this, how?

      • Well Perl::Tidy turns this:

        my $blodrfrf= $c->model('Fdsfkjsdlfkajd')->find({ id => $id, otehrs => $sdfkjsd });

        into this:

        my $blodrfrf= $c->model('Fdsfkjsdlfkajd')
                ->find({ id => $id, otehrs => $sdfkjsd });

        instead of:

        my $blodrfrf= $c->model('Fdsfkjsdlfkajd')->find({
            id => $id,
            otehrs => $sdfkjsd,
        });

        I'd appreciate any config hints you have, I just started and am currently trying to set it up to match our current c

      • I normally hit Command-Shift-H :P

        My .perltidyrc doesn't cuddle the ( and {, } and ) but I think I recall an option that covers that.

        Here's what that code looks like for me:

        my $link = API::Link->new(
            {
                rel  => 'meta:version',
                href => $uri->as_string,
                type => 'application/xml'
            }
        );

  • cperl-mode handles most of this, but its implementation is sort of broken.  I guess I will be fixing that sometime soon.

    One nit on your elisp code... the style like this:

    <code>
    (foo
      (bar
        baz
      )
    )
    </code>

    Looks really weird.  All the close parens should be on the same line:

    <code>
    (foo
      (bar
        baz))
    </code>

    This is the "official" emacs lisp standard, and I think most other Lisps like the same sort of formatting.