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

Re^3: Substitution with regex and memory consumption

by dave_the_m (Monsignor)
on Mar 01, 2020 at 22:47 UTC ( [id://11113608]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Substitution with regex and memory consumption
in thread Substitution with regex and memory consumption

That's roughly it, yes.

Dave.

  • Comment on Re^3: Substitution with regex and memory consumption

Replies are listed 'Best First'.
Re^4: Substitution with regex and memory consumption
by k-mx (Scribe) on Mar 08, 2020 at 08:16 UTC

    Isn't this behavior incorrect? Why we must copy variable on each substitution?

    I think we can: respect PL_sawampersand and /p flag for substitution and have only one copy for string (last one) in current scope.

      As always the devil is in the detail. Consider for example:
      { $s = ".....X....."; $s =~ s/X/Y/; $x = eval q{ "[ $`$& $' ]" }; }
      You can't rely on PL_sawampersand.

      Dave.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11113608]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found