in reply to Re: split() problem
in thread split() problem

"split uses a regular expression and not a plain string."

Thanks for that answer.
/\*/ works, "\*" fails because of delimiters in regex.
Bad day for me, many thanks for your help :)

Replies are listed 'Best First'.
Re^3: split() problem
by shigetsu (Hermit) on Jan 24, 2007 at 09:23 UTC
    "\*" fails, because "" interpolates \*, which results in a bare *.

    Watch following:

    $ perl -wle 'print "\*"' *

    So you actually should, if (see Corion's reply), use '\*'.
Re^3: split() problem
by ikegami (Patriarch) on Jan 24, 2007 at 17:18 UTC

    "\\*" would work.

    The string literal "\\*" results in the string \*.
    When used as a regexp, the string \* matches *.

    Save yourself a lot of headaches and always use /.../ (or m{...}) with split.