in reply to help with comparing two arrays of phrases
The problem is that this:
$temp_array[1] =~ s/\(\)//g; # Remove parentheses to avoid mishaps + during pattern matching
Will only remove parenthesis if the appears in together in matched pairs.
Ie. It would remove these "fred () bill () john", but not these "(fred)(bill john)".
A better way to remove all parens is to use tr///. Eg. $temp_array[1] =~ tr/()//d;
You could also use: $temp_array[1] =~ s/[()]//g;
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: help with comparing two arrays of phrases
by sdtej (Initiate) on Oct 10, 2012 at 07:38 UTC | |
by BrowserUk (Patriarch) on Oct 10, 2012 at 08:40 UTC |
In Section
Seekers of Perl Wisdom