in reply to Variable as split delimiter
Your problem is your line: $delimiter = "\|"; Because you are using a double-quoted string that does it's own \-escaping, this sets $delimiter to just "|". Then using it in a regex as /$delimiter/ becomes /|/ (match nothing or nothing) which matches between every character, so you get "1", ".", "1", etc. from your split.
To set $delimiter properly to \|, use $delimiter = "\\|"; or $delimiter = '\|';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Variable as split delimiter
by punch_card_don (Curate) on Mar 26, 2008 at 15:59 UTC |