I just wanted to get something straight that I read in Learning Perl 3rd Edition. I am on Chapter 4 Subroutines. I am wondering if after you define a subroutine with the & character that I can just say sub then the subroutine. For example can I....
and then after I have defined that subroutine can I run it later in the script by just saying....&max { if ($a=$b){ print "hey!, that's the same thing./n"; } else { print "those aren't the same things.\n";
sub max that is my question. Can I? Also, if you have any extra time please tell me what it mean when you can "omit the ampersand" when using subroutines. Is it like I said when you say "Sub max", or something totally different?
-@rocks
In reply to Defining Subroutines by @rocks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |