How can I create a Perl script to get some “named” command line arguments?
For example:
perl my_perl.pl -ARG_1 1234 -ARG_2 "Testing"
Where ARG_1 and ARG_2 are the arguments names and 1234 and “Testing” their values.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can get a similar effect by using Getopt::Long. The main difference is that it uses gnu-style –arguments by default. It’s very flexible and powerful.