in reply to String Match

You don't need quotes inside the regex (the paired slashes do that job), including them searches for quotes inside your string, which you don't have. That makes:
if($line =~ m/API#/) { ...
UPDATE: Thanks for the replies, as ww indicates, you actually want to negate the search on the second # symbol, as his solution does (see below).

Replies are listed 'Best First'.
Re^2: String Match
by ww (Archbishop) on Nov 30, 2009 at 13:06 UTC
    Almost.
    if($line =~ m/API#[^#]/) { ...

    The negative character class makes the regex reject the doubled-#, as per OP's question.

    Update: Better answer below at Re^3: String Match. ++ happy.barney!

      better is to use negative look around assertion: m/API#(?!#)/, it match also end of line.
Re^2: String Match
by zeni (Beadle) on Nov 30, 2009 at 13:03 UTC
    This din't solve the problem. It says "Matched".