[OT] PerlTidy option to close parens on function params *only*

PERL

    Next

  • 1. how to concat two strings into one?
    hi, greetings, I am a newer for PERL. I want to concat two strings into one string, like this, $stringA='This is '; $stringB='A concat example!'; I want to $stingC to be this: $stringC="This is A concat example!"; I searched the help, but did not find the right function, Can you guys help me figure this out? Thanks bugzilla
  • 2. toast
    if ( $c=~/t[aeiou]st[aeiou]/i) {print STDOUT "A toast to my test about testes which took testicles to post\n";}

[OT] PerlTidy option to close parens on function params *only*

Postby newsbot » Wed, 04 May 2005 05:00:58 GMT

Since I don't consider this question strictly Perl related, I've marked
as [OT].  Yet at the same time, I'm not sure where else to ask it since
no one other than Perl users would conceiveably use PerlTidy.

That said, I want to provide an option or options to PerlTidy that
format parenthesis in this fashion:

for (1..10) {
   do_something( $_, "Dude" );
}

-or-

if ($a < 10) {
   do_something( $a, "Dude" );
}

In other words, parens after keywords like "while," "for," and "if"
etc. stay tight (eg. no whitespace), whilst parameters passed to
subroutines are formated with one space as with "do_somthing()" above.

The PerlTidy man page provides no options that I can see other than
tight parens EVERYWHERE.  Also the PerlTidy home page offers nothing
revealing either and there is no list associated with this product that
I can see.  I was hoping I might trip across someone here that is
experienced enough with PerlTidy to offer a solution to the above.

Right now, I'm living with tight parens globally.  But I'd rather have
white space around my parameters to subroutines.

Thanks!
-ceo


Similar Threads:

1.Params::Check vs Params::Validate

Hi all,

I need your advice about choosing a module for parameter checks.
There are two modules I've found interesting and they are similar:
Params::Check and Params::Validate.
At first glance I would prefer Params::Validate because it has a xs
version. On the other hand Params::Check is in the perl 5.10 core
module list. Does anyone know why the perl core developers prefered
Params::Check on Params::Validate ?

Thanks,
David

2.Use of alternation with "selection" parens

3.nested parens

Is there a module out there that I can use to parse a text line and return the pieces that are enclosed in paren's?

Thanks


4.matching balanced parens

I have tried for a while to figure out how to use the experimental
perl regex balanced paren feature (perlfaq6), but failed.  if this is
possible, could someone please give me an example of the magic
invokation?

  $text= "this is \macro{a { irrelevant } b} and this is \macro{c
{e{}}{} d}"
  $text=~ s/\macro{ [matching .* to closing] }/\macro{***}/g;  # help
here
and I would get
  $text eq "this is \macro{***} and this is \macro{***}"

Is this even possible with regex?  If not, could someone please point
me to the recommended method for global balanced substitutions (not
just matching)?

help appreciated.  /iaw

5.grammar function [OT - English Grammar]

"Ken Sington" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
>
> chair remains chair if there are one or zero.

You have "zero chair"?  "zero desk"?  That doesn't especially sound like
correct (American) English to me.  Singular is used for one item.
Plural is used for not-one items.

Paul Lalli

6. Close function blocks forever when reading from piped output

7. SFTP Close Function

8. Perltidy option to generate/keep BSD Style of bracketing ?



Return to PERL

 

Who is online

Users browsing this forum: No registered users and 38 guest