I haven't tested this, but the gist is
%mod = 'MODNAME.mod';
$area = $_;
for (%mod['*.git']) {
for (/{'Placeable List'}) {
print $area,/~/TemplateResRef, ";", /~/OnHeartbeat,";", "\n";
}
}
I've put in \n to print each instance on a new line, which you might not want!
$_ returns the current instance of the loop variable. This will be the name of the .git file. Hopefully that's good enough. EDIT : If you have to have the area name see post below. , I'm not certain how to do it, though you could try
$area = $_;
for (%mod[$area + '.are']) {$areaname = /name;}
If you're only looking for one script, you could make the print conditional, e.g.
if (/~/OnHeartbeat eq '++name of script here+++') {print $area,/~/TemplateResRef, ";","\n";}