in reply to Parsing a sentence based on array list
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;
|
|---|