in reply to smart solution

In addition to the comments by Beth, the following line should be corrected:
if ($line =~ /SERVICE_APPLICATION_EXECUTION_COMPONENT)
to
if ($line =~ /SERVICE_APPLICATION_EXECUTION_COMPONENT/)