© 2005 A.P. Lawrence
foo Hey! 1
Because print evaluates its rightmost terms first, the "mysub()" is called before the "Hey! " is printed. That prints "foo" and returns a value of "1". The "Hey !" is evaluated and printed, and then the "1" that "mysub()" returned.
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
/Tests/Perl/e0009.html copyright Tony Lawrence All Rights Reserved
| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 1 | 1 | 1 | 192 | 812 |
Fri Feb 10 15:36:45 2006 This is a test at correcting not writing anonymous
This is a typical test written by people who correct papers for a living.
I there is any meaning in rating people's programming skills based on whether
or not they can fix bad subtle code using grammar they would never come
up with. It is like having you fix someone's essay and then grading them
on it - it easier to write your own and hardly means you can't write.
/>
Fri Feb 10 15:59:06 2006 TonyLawrence
I don't correct papers for a living :-)
My intent is not as you portray it. The intent is to test knowledge of
syntax. Agreed, sometimes I use "bad code" to do that, but so what? You
should be able to evaluate the result regardless.
Add your comments