in reply to strange usage of s/// [solved: Perl 5.14 and 5.16 bug]
B::Deparse seems to understand and to see difference between variants:
1) Original:
perl -MO=Deparse -e '$_="abcdef"; s/@{[s".."."gr]}\K$"//; print' $_ = 'abcdef'; s[@{[s/.././rg];}\K][$"]; print $_; -e syntax OK
Do the rigth thing, but why?!
2) Litteral space char (not $"):
perl -MO=Deparse -e '$_="abcdef"; s/@{[s".."."gr]}\K //; print' $_ = 'abcdef'; s[@{[s/.././rg];}][\\K ]; print $_; -e syntax OK
Strange, isn't it? :). I'm confused...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: strange usage of s///
by smls (Friar) on Sep 03, 2013 at 22:25 UTC | |
by brx (Pilgrim) on Sep 04, 2013 at 17:33 UTC |