Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Multi-line comments in perl code?

by Moron (Curate)
on Jul 14, 2006 at 13:34 UTC ( #561211=note: print w/replies, xml ) Need Help??


in reply to Multi-line comments in perl code?

You could plan to run all your Perl sources through the C preprocessor before further use and that way co-opt its functionality. The added benefit is that you can then use all of the C preproprocessor functionality, e.g. macros, defined pre-execution symbols and so on in your Perl code - in fact this particular usage pales into triviality compared with what then becomes possible for projects with complex implementation and/or porting requirements.
#!/usr/bin/perl #IFDEF COMMENT #+++ I am a comment - symbol COMMENT is left undefined So there Instructions: this file is called fred.plp and should be run through the C preprocessor with output to fred.pl - modules could be presourced with the extension .pmp #--- #ENDIF my $x = 1; open my $fh, '<fred'; # etc. __END__

-M

Free your mind

Replies are listed 'Best First'.
Re^2: Multi-line comments in perl code?
by davorg (Chancellor) on Jul 14, 2006 at 13:39 UTC
    You could plan to run all your Perl sources through the C preprocessor before further use

    There's even a command line option (-P) which does just that. Tho' it has to be pointed out that the docs say "Use of -P is strongly discouraged because of its inherent problems, including poor portability".

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-08-14 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (76 votes). Check out past polls.

    Notices?