Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Removing chars from a word from an array

by superfrink (Curate)
on Jan 25, 2006 at 03:56 UTC ( #525365=note: print w/replies, xml ) Need Help??


in reply to Removing chars from a word from an array

Update:murugu already posted this solution and blazar suggested using a character class in the regex.

#!/usr/bin/perl -w use strict; # input from ikegami my $word = 'abracadabra'; my @list = qw( a b c d e ); my $pattern = join("|" , @list); print "pattern: $pattern\n\n"; print "before: $word\n"; $word =~ s/$pattern//g; print "after : $word\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-01-26 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?