Script to optimize multiple structure files continuously

I am a beginner perl script.


I would like to write a script that performs structure optimizations in succession once the job is submitted.


For example, when there are 3 structures such as benzene.xsd, methane.xsd, and phenol.xsd, I would like to make structure optimization with the same calculation option for multiple structures once I submit a script job.


One more thing here, Even if the benzene.xsd structure optimization has failed, I would like to ensure that the remaining two structure optimization tasks are not interrupted.


With my short knowledge, I wonder if I should use the "for" and "if" syntax, but it is very difficult.


Is there anyone who can help with this?


++ I am going to perform DMol3 optimization.