in reply to Re^2: Surprised by split
in thread Surprised by split

That would cause a problem if $opt_d equals ^. Perl seems to handle the cases /[-]/, /[[]/, /[]]/ as the appropriate single character class, but it trips on /[^]/. I wonder whether that's a bug (or a yet unimplemented feature).

Of course, you can get all sorts of unexpected nonsense if $opt_d is longer than a single character. Or if it's the empty string.

Replies are listed 'Best First'.
Re^4: Surprised by split
by sk (Curate) on Aug 11, 2005 at 16:59 UTC
    Thanks for the info on pitfalls!!! For me, usually it is from a well behaved/nicely formatted data and almost always contains one of the following delimiters ",","\t","|"," ",":"