O'Reilly logo

Sams Teach Yourself Perl in 21 Days, Second Edition by Rafe Colburn, Laura Lemay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Workshop

The workshop provides quiz questions to help you solidify your understanding of the material covered and exercises to give you experience using what you've learned. Try to understand the quiz and exercise answers before you go on to tomorrow's lesson.

Quiz

1:What do the following Perl switches do (with regard to one-liners):
-e
-i
-p
A1: The -e option runs a Perl script on the command line (a one-liner).

The -i option edits files in place; that is, the result of the script will be saved back to the original file. Any file extension argument to the -i option will be used to save the original version of the file.

The -p option surrounds the Perl one-liner with a while (<>) loop with a print statement at the end. If you want to perform ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required