Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Scrubbing a string

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

in reply to Scrubbing a string

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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2021-05-14 13:58 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.