
Can anyone help on these questions which i couldnt answer in my interview,because iam not sure on perl scripting iam learning the things in perl now.
1.What standard Perl modules have you made use of, and why did you use them instead of the equivalent built-in functions?
2.Write a statement that checks to make sure there are at least two command line arguments and exits with an error if not.
3.How do you find the number of elements in an array?
4.Write a regular expression that would match only the last director of a full path filename (and you don’t know the path ahead of time). Example: for “/fee/fi/fo/fum.txt” you would match “fo” with your regular expression
5.Write a Perl script to get the machine host name and print it. No system command should be used; this script should work on Windows and Linux OS without any change.
6.Write a Perl script to check a directory exists or not and print proper message. The directory location will be passed as parameter while executing the script.
Please help me out for the above questions.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals