in reply to Perl Script performance issue
To correct this, you should use the \Q escape sequence. That tells perl to treat the pipe as a regular character and not mean OR in the regular expression.
I saved a file of what are called the 'dirty dozen' of metacharacters. The pipe is one of the dirty dozen. They are:
\ | ( ) [ { ^ $ * + ? .
They all need escaping if they are to be treated as a 'regular' character in a regular expression (not as a metacharacter). So, your split should look like
split(/\Q$hash_ref->{DELIMITER}\E/
(There also is the quotemeta built in function).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Script performance issue
by AnomalousMonk (Archbishop) on Dec 15, 2015 at 15:30 UTC | |
by Tara (Initiate) on Dec 16, 2015 at 08:58 UTC |