in reply to references to subroutines
You are not really using references to pass arrays (or did you really mean single array elements?) into the subs. You first create a reference (i.e. $ref) but then you dereference it (i.e. @{$ref}) before giving it to the add or multiply sub.
What was probably meant was to pass just $ref into the sub and then dereference it there.
|
|---|