in reply to character recognition

Your regular expression is probably not doing what you think it is. It matches a line that has a literal 'scor', zero or 'e's then a literal '"cool"'. You probably mean to use '.*' to match zero or more characters (except newline).

if ( my $line =~ /score.*$song/ ) { ... }
but without seeing the input you expect to match I can't be sure.