Some of my perl statements are executed even after commenting. I tried all the delimiter #
, /*..*/
, //
Does anyone face the same issue or can anyone help me how to solve this issue?
Asked
Active
Viewed 152 times
-5

TLP
- 66,756
- 10
- 92
- 149

user2382290
- 111
- 1
- 5
-
6Please post examples – Digital Trauma Oct 03 '13 at 15:30
-
2please post examples showing what you did, what you expected to happen, and what actually happened, in sufficient detail that someone else can take your example and observe the result you did. – moonshadow Oct 03 '13 at 15:31
-
5`/* .. */` and `//` are not comments in Perl. The first one might be interpreted as a regex, the second is the defined-or operator. – TLP Oct 03 '13 at 15:37
-
Show a [Short, Self Contained, Correct (Compilable), Example](http://sscce.org/). The problem you have is because of your source code, it cannot be solved without knowing your source code. The best you can get is a guess, and trying to guess is annoying at best. – TLP Oct 03 '13 at 15:42
-
2At the command prompt type "`perldoc perlintro`". Fifteen minutes later you will have the answer to this, and many other "getting started with Perl" type questions. – DavidO Oct 03 '13 at 15:53
-
Thanks everyone.i got the mistake... – user2382290 Oct 03 '13 at 16:30
-
You haven't supplied enough information to know what your problem is, but assuming you're having trouble with multi-line comments, see [this SO question](http://stackoverflow.com/questions/3828205/how-do-i-enter-a-multi-line-comment-in-perl). – Jack Bracken Oct 03 '13 at 15:33
1 Answers
2
Your question appears to be "How do I create a comment in Perl?"
perlsyn says thusly:
Text from a "#" character until the end of the line is a comment, and is ignored. Exceptions include "#" inside a string or regular expression.
For example,
print "apple\n"; # Keeps the doctor away.
Keep in mind that comments can only be used where whitespace is expected. For example, the following does not contain any comments since the #
is part of the string literal.
print "apple # Keeps the doctor away.
orange
";

ikegami
- 367,544
- 15
- 269
- 518