• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

philosophical Perl question

ynotravid

Senior member
Why doesn't Perl have multi-line comments?

I am fairly new to Perl and one the first things that I've noticed is that Perl doesn't have support for multi-line comments. Although there are work arounds for this I don't see any good reasons as to why it isn't a part of the perl compiler(you know what I mean) itself.
 
Because when I put a # at the beginning of a line vim autmatically puts one at the beginning of the next line for me?
 
Originally posted by: singh
Because most programmers don't use Perl 😉
Point taken, but it's not like it would take a major structural overhaul in order to acomplish this. Even if it were only Lary Wall himself usin this language it would seem to me sensible to include that kind of functionality.

 
It also seems you can use POD directives like:

=begin comment

This is a multiline
comment

=cut comment

There is a discussion on this for perl6, the main technical problem is picking good notation to mark the comments because common things like /* and // are used by the regexp engine.
 
When I need to comment out code for debugging purposes I usually encapsulate the stuff I want commented by making it a sub-routine and not calling it 🙂
 
Good work arounds, I hadn't heard that one befor Mucman. But I guess my question is why is the need for multi-line comments still a question. There are plenty of character combonations still available. And while you can get around the problem, there is no good reason, I can see, why you should have to.

 
Back
Top