in reply to Regex variables with delimiters
... the =~ operator has been cunningly designed so that ... there is a builtin assumption that it uses '/' delimiters ...
A counterexample:
c:\@Work\Perl\monks>perl -wMstrict -le "my $raw = '/this/stuff/'; print 'raw: yes' if 'does/this/stuff/match?' =~ $raw; ;; my $regex = qr/$raw/; print 'regex: yes' if 'and/this/stuff/also?' =~ $regex; " raw: yes regex: yes
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex variables with delimiters
by clerew (Novice) on May 19, 2019 at 15:11 UTC | |
by AnomalousMonk (Archbishop) on May 19, 2019 at 15:59 UTC |