Jul 8, 2016, 6:01 AM
Post #5 of 5
Your long print statement does not compile. The error message that you receive refers to the following substring from that statement: ")[)$i". It tells you that an operator is required between the right parenthesis and the $i. Unfortunately for you, perl gives up and reports this error before it has a chance to discover that this combination of parenthesis does not make any sense.
I cannot fix it for you because I cannot begin to guess what it is supposed to do. Good practice dictates breaking this complex statement into several simpler ones. Debugging would be much easier. Please post either corrected code or a clear description of your objective.
Even after you fix your syntax, your program will still not work as you intend. The first argument of split is a regular expression. You may code it as a string, but regex syntax still applies. The pipe "|" character has special meaning in a regex. It must be escaped to represent itself.
I could make several comments on your style, but lets get this version working first.