Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Substitution with regex and memory consumption

by dave_the_m (Monsignor)
on Mar 01, 2020 at 22:47 UTC ( #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
Node Status?
node history
Node Type: note [id://11113608]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2020-10-30 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (284 votes). Check out past polls.

    Notices?