- or download this
scrub 'pure', 'p!u-r-*e'; # returns pure
- or download this
sub string_clean {
my ($pure, $dirty) = @_;
...
my @cleaned = grep { $pure{$_} } @dirty;
return join '', @cleaned;
}
- or download this
scrub 'impure' => 'pure' ; # yields 'pure'