Actually, I get "FirstSecond2311".
The extra 1s are the return values from the functions first and second. As they don't have explicit return statements, they both return the result of the last expression evaluated. In both cases, that's a call to print. And print returns 1 (i.e. true) if it prints successfully.
For extra credit, explain why it doesn't print "23First1Second1" - which would seem to be the most obvious result.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: Martin Brown book page 33
by davorg
in thread Martin Brown book page 33
by mnooning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |