in reply to Re^2: Counting the start and end elements in a line
in thread Counting the start and end elements in a line
When I call the function
counttags(+);
When the script is compiled, I get a error,
Syntax error at vtag.pl at line 275, near "+)"
Execution of vtag.pl aborted due to compilation errors.
Yes. That's what I expected. You can't just drop an operator in the middle of some source code at random and expect the compiler to know what to do.
On the otherhand, if I have the code as counttags("+");, the $stag and $etag values remain 0.
This is probably because of one of the other errors that have been pointed out to you in this thread. Developing with use strict and use warnings will almost certainly help you track down problems like this.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|