Seeking a Perl Script for Thermosetting Phenolic Resin Crosslinking

Hello everyone,

I am looking for a Perl crosslinking script for a thermosetting phenolic resin in Materials Studio.

The desired crosslinking mechanism is the conventional condensation reaction of phenolic resin. Hydroxymethyl groups should react with phenolic sites within a predefined cutoff distance to form methylene (-CH₂-) bridges by eliminating the corresponding atoms (e.g., H and OH). The final crosslinked network should still retain a portion of the hydroxymethyl (-CH₂OH) and phenolic hydroxyl (-OH) groups, rather than reaching complete conversion.

If anyone has a similar Perl script, example code, or relevant experience, I would sincerely appreciate your help.

Thank you very much!