Mar 13, 2021

PERL Automation Script in Linux/Unix Environment



PERL as a programming language is used for automation in the the VLSI industry.In this industry most of the the EDA tools are command line. Hence we have to use any kind of shell or Scripting Language to automate the VLSI tool flow. PERL is a chosen language because it has its own ability to to match Regular Expression (RegEx) match your level of of Shell Interaction and easy debugging methods.



In this particular example we have chosen a challenging scenario where we have to use PERL as a automation language and do a mammoth amount of task in an very easy way. In this particular case each Rar file has multiple JPG files which we need to to convert and combine into one single PDF. At beginning this seems to be a very easy task. Yes you are right this is very easy when we do only few of such conversions. when this amount of RAR files is is at large , Say we have thousand search RAR files, then at this situation the task will become Mammoth, error will come every now and then. We did not consider any manual mistake that can take place. To deal with such scenario we have to design one PERL automation that will help us to achieve the goal with zero human mistake and maximum accuracy.



Now at the situation we have huge number of RAR files which we need to convert EACH into one single PDF. So we need an automation script using PERL. To capture the error warning coming from any unit tool included in this automation. So  in this coding will use a PERL module which will create a professional looking log file for or normal screen outputs as well as error/warning. 

For Detailed Description & Usage Please See the video below: 



Here is the PERL Code :

Useful Tips : 

In case you are facing the issue with PDF conversion in ImageMagick convert binary  then 

1. Open : sudo gvim /etc/ImageMagick-6/policy.xml

Your Installed Version of ImageMagick may be different , then choose the above file corectly from the same path in /etc/.....

2. Edit the policy.xml file as :

  <policy domain="coder" rights="read|write" pattern="PS" />

  <policy domain="coder" rights="read|write" pattern="PS2" />

  <policy domain="coder" rights="read|write" pattern="PS3" />

  <policy domain="coder" rights="read|write" pattern="EPS" />

  <policy domain="coder" rights="read|write" pattern="PDF" />

  <policy domain="coder" rights="read|write" pattern="XPS" />

3. Save the file and exit.


Thanks for Reading The Blog ! 



Courtesy: www.pngegg.com