in reply to Re^4: [Homework Question] Subroutines & References
in thread [Homework Question] Subroutines & References
I would state it slightly differently. The function returns nothing different when it is passed no parameters because it takes no parameters — or more precisely, it does nothing with any parameters it may be passed. The array @list_of_numbers is accessed (not declared) within the function. This treats the array as a global variable (even though technically it is lexical). I notice other instances of such access in your functions. Accessing a mutable global (as opposed to a constant) within a function is generally considered a Bad Thing, and is officially Frowned Upon. You have been warned.
Give a man a fish: <%-(-(-(-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: [Homework Question] Subroutines & References
by Hayest (Acolyte) on Feb 11, 2015 at 19:48 UTC | |
by AnomalousMonk (Archbishop) on Feb 11, 2015 at 20:38 UTC |