Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Learning to *really* love referencesby TGI (Parson) |
on Jul 31, 2002 at 20:59 UTC ( [id://186602]=note: print w/replies, xml ) | Need Help?? |
You can also use sub prototypes to help make things pretty. They'll give you some argument checking capability, and will convert your arrays into refs for you. Here's a simple example:
Applying this to your code, we get something like (notice how clean the subroutine call is):
Check out perlsub's section on prototypes for more info. Update: Of course protoypes are a bit controversial...
In Section
Meditations
|
|