Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Scrubbing a string

by Limbic~Region (Chancellor)
on Aug 24, 2007 at 22:31 UTC ( [id://634985]=note: print w/replies, xml ) Need Help??


in reply to Scrubbing a string

princepawn,
I have thought about this for 20 seconds. Since your solution disregards order and count, it seems that this can be generalized into saying "this set can't have any members that are in that set". If I were putting this into a module, I would likely use a tied interface to the 3 main data types (hashes, arrays, scalars).
tie my $string 'Set::Avoid', not => 'this'; $string = "This is how you do it"; print $string; #T ow you do"
It should be obvious how this would work for arrays and hashes but you would run into problems with scalars if they ended up being references.

Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found