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";
|
---|
In Section
Seekers of Perl Wisdom