Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Parsing a sentence based on array list

by vinoth.ree (Monsignor)
on Jul 19, 2013 at 05:40 UTC ( #1045257=note: print w/replies, xml ) Need Help??


in reply to Parsing a sentence based on array list

Hi neversaint

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045257]
help
Chatterbox?
[beech]: checking chatterbox sidebar
[beech]: and again a check on chatterbox sidebar, what is expandability
beech me me me me me me testing chatterbox sidebar
beech my my /me me me me me me me chatterbox sidebar
beech testing chatterbox sidebar
[beech]: and something else

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-03-27 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (324 votes). Check out past polls.