in reply to Parsing a sentence based on array list
Hi neversaint
All is well
Here is one of the way to remove the strings matched in the line from the array.
use strict; use warnings; use Data::Dumper; my $line ='Lorem ipsum dolor sit amet, consectetur adipisicing elit'; my @array1 = ('ipsum', 'sit amet', 'elit'); foreach(@array1) { $line =~ s/$_//g; } print $line;
All is well
|
---|
In Section
Seekers of Perl Wisdom