Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: strange usage of s///

by brx (Pilgrim)
on Sep 03, 2013 at 20:27 UTC ( #1052174=note: print w/replies, xml ) Need Help??


in reply to Re: strange usage of s///
in thread strange usage of s/// [solved: Perl 5.14 and 5.16 bug]

$_="abcdef"; s/@{[s".."."gr]}/$& /; print; [download]
This variation of yours does in fact work (prints "abc def"), and so do the following ones (which are closer to the original solution by "tails")

Not for me. It prints "...abcdef" (with perl v5.14.4).

Thus I conclude that the original "solution" is the result of a typo (separator '/' put in the wrong place), and cannot work.

No typo. Code is good. You can test it on: http://golf.shinh.org/p.rb?Bisection

English is not my mother tongue.
Les tongues de ma mère sont "made in France".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1052174]
help
Chatterbox?
[msh210]: I think I just found a lie in perldoc.
[msh210]: warn: "If the last element of LIST does not end in a newline, it appends the same file/line number text as die does."
[msh210]: perl -e'warn "test$/", "" '
[msh210]: doesn't append anything.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2017-04-24 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (439 votes). Check out past polls.