in reply to Re^3: Matching dot using regexp
in thread Matching dot using regexp

Somewhere in the middle of that doc it says that PATTERN can be
a string composed of a single space character (such as ' ' or "\x20" , but not e.g. / / ).
However, the only PATTERN strings that I find there are whitespace (PATTERN defaults to " " if omitted) and the empty string.

Replies are listed 'Best First'.
Re^5: Matching dot using regexp
by AnomalousMonk (Archbishop) on Oct 10, 2017 at 10:46 UTC

    split is happy with any string (or anything that can be converted to a string) as a /PATTERN/, e.g.,

    c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my $tim = '10:00:10.004'; ;; my @outputlist = split '[:.]', $tim; dd \@outputlist; ;; my $p = 10; @outputlist = split $p, $tim; dd \@outputlist; " [10, "00", 10, "004"] ["", ":00:", ".004"]
    However, I would incline to use  // qr// m// for any but the most simple and straightforward patterns; I vaguely recall pitfalls involving backslashes.


    Give a man a fish:  <%-{-{-{-<