in reply to qw with comma delimiter

Let me restate my OP. I was sleepy when I first posted. Sorry:

I need no interpolation.
The delimiter must delimit complex data.

I am worried that whitespace and perhaps even commas couldn't get the job done. What if I have data like "dfs$$$\,, =>/?" and I need to separate it from "fd s fs%%#&//lp". It seems that whitespace and commas are too simplistic as delimiters.

Update: The data will contain quotes. Let's say it can contain anything. Any possible character or combination of characters. How can I properly delimit this and prevent interpolation at the same time?

Replies are listed 'Best First'.
Re: Re: qw with comma delimiter (repost)
by cfreak (Chaplain) on Jul 26, 2003 at 15:39 UTC

    Why can't you just create it without qw() using single quotes so you don't get interpolation?

    my @array = ('dfs$$$\,, =>/?','fd s fs%%#&//lp');

    The other option if you must use qw() would be to run your parameters through some sort of filter first that escapes the spaces but that seems to defeat the purpose of using qw at all, and is only the opposite of what you just suggested (splitting on the commas after coming out of qw().

    Like many others I don't understand why using qw() is a must since there are tools for doing exactly what you want to do. Single quoting separated by commas should do exactly what you want.

    Lobster Aliens Are attacking the world!
      Like many others I don't understand why using qw() is a must

      Note: I never said qw// was a must. Nor do I have a "fetish" with it.

      Single quoting separated by commas should do exactly what you want.

      The data will contain quotes. Let's say it can contain anything. Any possible character or combination of characters. How can I properly delimit this and prevent interpolation at the same time?

        If the data can contain anything then there is no way to delimit it, as by definition it could contain the delimiter. Therefore you may need to rethink the way you are storeing the data. Is there a problem with single qoutes and then escaping newlines and qoutes (single and double)? The other option would be to use highly unlikely combinations of characters, like '...|||...' or anything else. ___________
        Eric Hodges