Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Find pieces of text in a file enclosed by `@` and replace the inside

by McA (Priest)
on Mar 08, 2013 at 12:16 UTC ( #1022408=note: print w/replies, xml ) Need Help??


in reply to Re: Find pieces of text in a file enclosed by `@` and replace the inside
in thread Find pieces of text in a file enclosed by `@` and replace the inside

Hi,

one question to the (very nice) solution: I'm not sure whether I'm right. Is it possible that there are perl bugs in older versions with exactly this kind of substitution pattern:

s/pattern/ func(bla) /ge;

I'm just curious. Probably it was in another context. Where are the perl core hackers?

Best regards
McA

  • Comment on Re^2: Find pieces of text in a file enclosed by `@` and replace the inside
  • Download Code

Replies are listed 'Best First'.
Re^3: Find pieces of text in a file enclosed by `@` and replace the inside
by bart (Canon) on Mar 09, 2013 at 21:27 UTC
    I'm not sure what you mean. But I know that $1 and friends are block scoped, meaning that it's safe, and has always been safe, to nest substitutions provided the inner substitution was in a block.

    Calling a sub is one safe way to achieve that. It also has the added advantage that you don't have to take care of having to escape any unpaired nested braces: the substitution part may look like a code block to us, but it actually isn't.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1022408]
help
Chatterbox?
[Discipulus]: sometimes the client dies for extra content </chatter><span class="error" style="color: #cc0000">Server Error (Error ID 9162
[Discipulus]: the span is considered extra content by the parser
[Corion]: Mhmm - that would be some internal error, but I can't look into that right now as I don't have access to the logs from here ;)
[Discipulus]: ah, but it can be skipped by the client (?)
[Corion]: I think so, but I wonder what error might be there...
[Discipulus]: raining in germany? ;=)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2017-07-25 08:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (366 votes). Check out past polls.