The problem is in this line:
split(/|/,$i);In a regular expression, the vertical bar is a metacharacter used to specify alternation. The regex asks for nothing or nothing. You should rather escape the pipe character so it is treated literally. (I find it strange that you escape it within a double-quoted string but not the regex. :)
split(/\|/, $i);There are several other opportunities to clean your code. Using strict and enabling warnings will force you to be more careful about variable usage. Using the CGI module will provide you with a better way of parsing input.
In reply to Re: How to write this code correctly ??? Please help
by chromatic
in thread How to write this code correctly ??? Please help
by britney
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |