Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: [Golfing] Uncommenting a block

by LanX (Canon)
on Apr 14, 2010 at 12:40 UTC ( #834665=note: print w/ replies, xml ) Need Help??


in reply to Re: [Golfing] Uncommenting a block
in thread [Golfing] Uncommenting a block

Thanks, interesting, but my (shortest) approach is not discussed (or only in more verbose versions)

From what I saw nesting and conditional commenting seem to be of special interest... which can be done with this solution:

if ($habibi) { print $habibi; <<'' if (0); #forget the following print " talks often much cr*p";<P> $h++ }

Warning about whitespaces in "empty" lines ending a heredoc seem to be a good application for code filters. (...finally)

Cheers Rolf


Comment on Re^2: [Golfing] Uncommenting a block
Download Code
Re^3: [Golfing] Uncommenting a block
by Hue-Bond (Priest) on Apr 14, 2010 at 13:06 UTC

    "empty" lines ending a heredoc have trailing spaces at the end, by definition. perlcritic catches that :).

    --
     David Serrano
     (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).

      > "empty" lines ending a heredoc have trailing spaces at the end, by definition.

      I'm not sure I understand what you mean with "by definition"...(?)

      you're suggesting to use perlcritic?

      I think a feature/syntax/pragma allowing trailing whitespace in Here-Docs would have many advantages.

      (Talking about the "right tool", emacs visualizes trailing whitespaces by default. ;)

      Cheers Rolf

        Maybe I quoted too little text. The topic was to warn about whitespace in emtpy lines. Well, empty lines have no content and if they have some whitespace, this whitespace is both at the beginning and at the end of the line at the same time. That was my "definition".

        --
         David Serrano
         (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-08-29 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls