What is the slickest way to programatically read from stdin or an input file (if provided) in Perl?
Share
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.
will read either from a file specified on the command line or from stdin if no file is given
If you are required this loop construction in command line, then you may use
-noption:Here you just put code between
{}from first example into''in second