Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: perlstyle - Unclear wording

by thor (Priest)
on Nov 18, 2005 at 14:48 UTC ( [id://509800]=note: print w/replies, xml ) Need Help??


in reply to Re: perlstyle - Unclear wording
in thread perlstyle - Unclear wording

How does a parenthesis “match on current line”?
Like-a-so:
( ($a eq "foo") && ($b eq "bar") )
In each case, the close parens "matches" it's open parens (the converse is also true). So, if it "matches on current line", the open and close are on the same line.

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^3: perlstyle - Unclear wording
by Aristotle (Chancellor) on Nov 18, 2005 at 14:54 UTC

    Doesn’t that make it a strangely particular style rule, though? It doesn’t make sense for someone like me who spaces all parens anyway, as in:

    ( ( $a || $b ) && ( $c || $d ) )

    And it looks weirdly out of place in code of someone who doesn’t, as in:

    (($a || $b) && ($c || $d) )

    Makeshifts last the longest.

      In the same vein, the following points from perlstyle don't make sense for me:
      • Be consistent.
      • Be nice.
      as I am neither. :-) perlstyle is a list of suggestions, not rules. If you like to put spaces around all of your parentheses, then you're obeying the rule by default. If someone follows the second style, they have a couple of choices; they can ignore the "rule" altogether or they can put a space after the far left opening parenthesis (which is what I do, incidentally). I agree that the docs might be cleaned up a little bit with a simple example.

      thor

      Feel the white light, the light within
      Be your own disciple, fan the sparks of will
      For all of us waiting, your kingdom will come

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found