in reply to Perlish Debugging Style

I won't comment on the so-called "perlish" style in general, except to make a loud gagging sound and mutter "over my dead body".

However, I don't know why you don't write:

print <<HEREDOC Some lines go here HEREDOC ; #this would be filtered out if I didn't leave a comment
as merely
print <<HEREDOC; Some lines go here HEREDOC
The lone semicolon would scare me, and likely get edited away.

Keep in mind that the heredoc indicator is standing in for a complete string at the given location. For example:

print <<DOUBLE_QUOTED . <<'SINGLE_QUOTED' . <<DOUBLE_QUOTED_AGAIN; This stuff is double quoted so I can see my $ENV{HOME} for home. DOUBLE_QUOTED This stuff is single quoted. I can make $10 really fast! SINGLE_QUOTED This stuff is also double quoted now. \a \a \a ding ding ding! DOUBLE_QUOTED_AGAIN
The statement acts as if I had said:
print "XXX" . 'YYY' . "ZZZ";
With XXX, YYY, and ZZZ being replaced literally with the following lines not counting the ending delimiter.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Perlish Debugging Style
by radiantmatrix (Parson) on Mar 02, 2006 at 17:07 UTC

    To be clear, I agree with your HEREDOC style, but I've seen many instances of the lone, trailing HEREDOC.

    Also, in response to:

    I won't comment on the so-called "perlish" style in general, except to make a loud gagging sound and mutter "over my dead body".
    I wish to reiterate that I would never allow these into code I release to anyone -- it's only to mark statements I want to remove later in a way that's (a)easy to manage programmatically {as compared to, say, indentation changes}, yet (b)provides visual distinction.
    <-radiant.matrix->
    A collection of thoughts and links from the minds of geeks
    The Code that can be seen is not the true Code
    I haven't found a problem yet that can't be solved by a well-placed trebuchet