in reply to Pros/cons of my/our sought
prosmy()cons
- creates package variables with ease
- visible across the scope of the file
- clutters package namespace
- visible across the scope of the file
- globals don't scale
prosBasically our() is designed for getting around using vars, whereas the use of my() encourages safer programming and goes hand in hand with strict which is a much praised practice in the monastery.cons
- creates lexical variables which are safer and don't dirty a package's namespace
- my()ed variables behave well and will destroy/untie/evaporate when they fall out of scope
- you can do funky things like closures with my()ed variables
- my()ed vars don't stick around long enough to pick up the cheque ;-)
_________
broquaint
|
|---|