[Bioperl-l] A perl regex query

Sendu Bala bix at sendu.me.uk
Tue Sep 18 13:21:06 EDT 2007

bioperl-list at superfrink.net wrote:
> On Tue, 18 Sep 2007, Nathan Haigh wrote:
>> An even better way is to use the array as Spiros suggested, but you
>> should then be able to use that in the regex like this:
>> my @ra_bad_terms = (  '-D-', 'Cyclic-' );
>> $string =~ s/@ra_bad_terms//g;
> I didn't know one could do that.  I couldn't get it to work so I asked 
> around.  In case anyone else read it and thought about using that code it 
> might only work in Perl 6.

I assumed it was a typo. You can get it to work by adding

$" = '|';

before the regex;

More information about the Bioperl-l mailing list