Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Is there a module for object-oriented substring handling/substitution?

by roboticus (Canon)
on Jan 26, 2013 at 17:25 UTC ( #1015517=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Is there a module for object-oriented substring handling/substitution?
in thread Is there a module for object-oriented substring handling/substitution?

smis:

Ok, now I understand what you're asking for. I had a slightly different model in mind.

So you're looking for the ability to do something like:

# X is regex stuff to detect start of "interesting region", Y detects +end if ($clob =~ /(.*)(X.*Y)(.*)/) { my ($stuff_before, $stuff_to_edit, $stuff_after) = ($1, $2, $3); $stuff_to_edit =~ s/foo/bar/g; $clob = $stuff_before . $stuff_to_edit . $stuff_after; }

But without all the gymnastics of dismantling and rebuilding the string. I can see where that would be pretty nice since a large $clob would force you to double the storage space and the associated string manipulations.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re^3: Is there a module for object-oriented substring handling/substitution?
Download Code
Re^4: Is there a module for object-oriented substring handling/substitution?
by smls (Friar) on Jan 26, 2013 at 22:44 UTC

    Yes, I think that's a good way to look at it.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-09-24 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls