Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Scrubbing a string

by princepawn (Parson)
on Aug 24, 2007 at 20:58 UTC ( [id://634963]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://634963]
Approved by TStanley
Front-paged by Roy Johnson
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-04-18 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found