http://qs321.pair.com?node_id=561211


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