in reply to String Match

If you want exact comparison, don't use regexes:
if ($line eq "API#") { ... }

If you want to use regexes, maybe you need some anchors. See perlretut.

Also the double quotes inside the regex are a bit confusing - you won't get any match with them, unless your line also contains literal double quotes.

Perl 6 - links to (nearly) everything that is Perl 6.