Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Multi-line comments in perl code?

by Moron (Curate)
on Jul 14, 2006 at 13:34 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://561211]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-23 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found