Several useful Perl modules

Source: Internet
Author: User
Tags perl script
Recently I used Perl to write a lot of automated testing tools. I have used some modules and I think it is quite good to record them. I may need to use them in the future.

Smart: Comments
Smart comments provides debugging and tracingCodeYou can print a variable value or trace and display the progress of a loop.
The most ingenious thing is that when you finishProgramWhen you do not need the debugging code, you only need to comment out

Use smart: comments;

This line is enough. When you need to debug the code again, you do not need to add the tracing code again. You just need to reactivate the above line of code.
If you do not use the preceding statement to activate smart comments explicitly in the program, you can activate the smart comments module explicitly when running the script:

$ Perl-msmart: Comments $ application. pl

Provides Perl with functions similar to C ++ macros
If a piece of code needs to be used repeatedly in multiple places, but writing a function is not very suitable. In this case, the best way is to use a macro definition similar to C ++, insert this macro as needed. You can use the filter: CPP module. After installing this module, it is no different from the macro of C ++.

Operate Excel files in perl
currently, many test cases and test reports for testing are written in Excel. Automated testing is required, it is best to use a Perl script to automatically read data from Excel and record the test results in the corresponding position. You can use the following modules to complete the related work:
if you need to read an existing Excel file (PARSE), you can use spreadsheet: parseexcel, applicable to Excel 95-2003. If you are using Excel 2007, you need to use the spreadsheet: XLSX module.
to create a new Excel file and write data, use the spreadsheet: writeexcel module.
to open an Excel file [...]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.