Workshop

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

Quiz

1:Name two reasons why subroutines are useful.
A1: Subroutines are useful for a number of reasons:
  • They help break up a large script into smaller bits to help manage complexity

  • Procedures in subroutines can be referred to by name to make scripts more readable

  • Subroutines can define local variables that are more efficient, easier to manage and control than globals

  • If you use the same code repeatedly throughout your programs, you can put that code into a subroutine, and then just reuse ...

Get Sams Teach Yourself Perl in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.