Q&A

Q1:Is there really any difference between using & and not using & when calling a function?
A1: None that should concern you at this point. A subtle difference does exist between &foo and foo when function prototypes are used or when a function is called without parentheses. These are topics well beyond the scope of this book, but for the curious, they're documented in the perlsub manual page.
Q2:When I use my($var) in a program, Perl responds with a syntax error, next 2 tokens my( message.
A2: You have either mistyped something or have Perl version 4 installed. Type perl -v at a command prompt. If Perl responds with version 4, you should upgrade immediately.
Q3:How do I pass (or return) functions, filehandles, multiple arrays, or hashes to ...

Get Sams Teach Yourself Perl in 24 Hours 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.