in reply to Why is it matching??

I'm a little confused on what you are doing, but perhaps changing
if ($_ !=~ [$target_name])
to
if ($_ !~ /$target_name/) or unless (/$target_name/)
will fix your problem.

- Tom

Replies are listed 'Best First'.
Re: Re: Why is it matching??
by bioinformatics (Friar) on Sep 11, 2003 at 21:20 UTC
    Using unless is the same difference (I tried it just for kicks, and it doesn't help). !~ on the other hand throws my program off completely. The program outputs nothing. Thanks for the input!!
    Bioinformatics
Re: Re: Why is it matching??
by bioinformatics (Friar) on Sep 11, 2003 at 21:46 UTC
    Hmmmmm...maybe you are right. !=~ could be an issue, depending on what has most priority, =~ or !=. If it is the latter, then what the regex effectively says is, if it is not equal to $target_name in reverse...~ by itself (addressing a non-numeric string)returns a string with identical length but with all the bits of the string complemented. I don't know if that effect is changed by the presence of // though... Could I be facing a double negation? If it is the former, then I would assume it would be the rough equivalent of !~.
    Bioinformatics