in reply to qw with comma delimiter
Not a favoured construct, but if your data doesn't contain newlines, you could get away with a non-interpolating HERE_DOC.
my @list = split $/, <<'END_OF_LIST'; £$%^&*( £@£@$@^&*£&*@' "$@':>< ;,. . ..^/ END_OF_LIST print join"-|-", @list;
Using single quotes around the label tells perl not to interpolate the contents. Using $/ or "\n" as the split format will do the delimiting and allow, leading, trailing and embedded whitespace, commas, quotes etc. Basically everything except newline.
If you need to embed newlines as well, then your probably into the situation of having to use hand crafted CSV with appropriate quoting and escaping and something like Text::xSV.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: qw with comma delimiter
by jacques (Priest) on Jul 27, 2003 at 03:14 UTC | |
by chromatic (Archbishop) on Jul 27, 2003 at 03:26 UTC |