I've recently become a PerlTidy fiend since I stumbled upon the hotkey in my IDE that runs it over my working file. Now I not only compulsively save my work, I also compulsively format it. Seriously, my compulsive saving habit is so bad that I have hit Ctrl+S at least twice while composing this post. No, I do not want to save this HTML page, thank you. Hooray for being both paranoid and OCD!
Anyway, optionless PerlTidy doesn't always quite get things formatted to my coding style and occasionally makes some inexplicable decisions. Fortunately, this is rare and PerlTidy and I agree on most aspects of Perl code formatting style.
Which brings me to my reason for posting. I have run into a formatting issue that just drives me bonkers and I want to find the right PerlTidy option(s) to fix it, as my IDE so graciously allows me to specify them in my preferences. A caricature of the code pre- and post-tidying follows:
#! perl -w # my preferred format use strict; my @bar = qw(nagas are snake people); my @zelgo = qw(of course); my @mer = qw(gosh a third nested loop); for my $foo (@bar) { for my $bie (@zelgo) { for my $bletch (@mer) { my $do = bless {}, 'stuff'; $do->DOES(['data', 'data', 'dataaaaaa', 'dataaaaaaaaaaaa' +]) or die "this is a stupidly long die message as you can s +ee from its length\n"; } } }
#! perl -w # after PerlTidy - curious formatting decision use strict; my @bar = qw(nagas are snake people); my @zelgo = qw(of course); my @mer = qw(gosh a third nested loop); for my $foo (@bar) { for my $bie (@zelgo) { for my $bletch (@mer) { my $do = bless {}, 'stuff'; $do->DOES( [ 'data', 'data', 'dataaaaaa', 'dataaaaaaaaaaaa +' ] ) or die "this is a stupidly long die message as you can see from its length\n" ; } } }
I suppose that the difference is not glaring when shown in codeblocks in a forum post. But boy does it drive me crazy what PerlTidy is doing with that long die message. Okay, I can live with PerlTidy wanting to dictate line length, but what fresh hell prevents it from aligning that string on the new line with... at the very least, the innermost enclosing for loop? Ideally, it would be aligned with the or die on the previous line. And what's up with that dangingly (aligned properly, at least!) semi-colon? C'mon, it does not need its own line.
I have examined the PerlTidy docs but there's an awful lot there and I just can't seem to think of how to word my problem so that I can find the proper option for correcting this annoyance.
I'm sure some kind monk has encountered this and has parsed the docs far better than I. Hopefully he or she is willing to share the PerlTidy option(s) necessary to make my code look pretty again? And if not... well, I need to be less OCD anyway.
In reply to need help divining PerlTidy option by temporal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |