CIS-33A - Programming in Perl
De Anza College
Summer Session 2009
- Perfect Perl Subroutine Programming:
- All data needed by the subroutine is passed into that subroutine via
the list of arguments inside parentheses in the call of the subroutine, i.e., &subname(arg1, arg2, arg3);
- The @_ parameters are given better names inside the subroutine.
- All new variables needed by subroutine are created as lexical variables, via
my. This includes the named parameters from the last point.
- No global variables are accessed or changed by the subroutine.
- The subroutine returns a value via return value;.
- The caller of the subroutine stores or otherwise uses that returned value,
i.e., $answer = &subname(arg1, arg2, arg3);.
- Assignment-02 Solutions demonstrate all of these points.
- Hand back and go over midterm solutions
- Go over solutions to Extra-Credit Quiz for Chapter 10 from last time.
- Chapter 12
- Lab: Work on Assignment-3. It's due in 2 days!