Perltidy: an option to keep sub($args){} as a single line?

151 Views Asked by At
$fs->traverse('/foo')->filter(sub ($name, $dir) { $name !~ /^\./; });
$fs->traverse('/foo')->filter(sub { $_[0] !~ /^\./; });

Is there any option to keep the first line as is? Because with -pbp perltidy breaks it into 5 lines because of a signatures feature.

1

There are 1 best solutions below

2
edibleEnergy On BEST ANSWER

perltidy -fnl ("If you do not want any changes to the line breaks within lines of code in your script") seems to work, though I'm not sure how you want the rest of your code to look.

https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy#Line-Break-Control