M
Michele Dondi
^^^^so it seems that stings other than ' ' are automatically converted to
regexen in the "obvious" (or "simplest"?[*]) way.
That's correct.
[*] It would be more obvious IMHO to convert $string to /\Q$string/.
That's not going to happen, since that would break a LOT of existing ^^^^^^^^^^^^^^^^^
code.
This is a good reason, but personally I'd find it very perlish to
allow for a diversified behaviour, not necessarily the one (I)
suggested above: typically whenever Perl admits for a variant on some
basic syntax, it will do something different, and usually *what I
mean*(TM)!
Some time ago I proposed to emit a warning when the first argument to
split is a plain string, but there are good arguments against it as
well. (and moreover I haven't produced a good patch for it either
Then the current documentation, even if *not* incorrect or misleading
(as someone else suggested), could be updated to mention that
(generic) plain strings can be used and explain how they will be
treated.
In particular
is that enough to explain PATTERN? [snip]
what more would you want? the first argument to split is a PATTERN. also
known as a regex, regular expression
But your claim underlined above, if true, and I do not have any reason
to doubt it is, contradicts him to some extent. Only to some extent
because he speaks of "pattern" or "regex" and not of "m// operator";
OTOH 'perldoc -f split' only mentions "/PATTERN/"...
Michele