(how) can you build a mesostructure template with the perl script?

I am writing a script in MaterialsStudio 2023 and I need to build a mesostructure with a certain cell length, which I calculate previously. The system should contain 2 slabs as filler. Does anyone has a suggestion for the perl code?
scriptperlmesostructuretemplate