in reply to Can someone help me make this script more efficient
Some quick comments:
You should look at using return rather than using a global variable to return results from a function.
Just like you need to learn how to return values to a function, you need to learn how to pass arguments to a function (such as $coin to pence).
Your teacher or teaching material is giving you some bad advice if it advocates using & on function calls. The & is not just decorative.
use strict; will reveal many errors, easily fixable by using my. You should be using use warnings; as well.
|
|---|