Subject: | Doesn't actually disable strict or warnings |
I saw this module hit the release feed and got curious as to how it worked .... and then saw the source and realised it probably didn't really work as you intended, which may be some misunderstanding how 'eval', 'strict' and 'warnings' work.
strict and warnings affect their *compilation* scope at *compile* tiime, so turning off strict and warnings inside the eval **doesnt** turn off strict and warnings in the context that defined the sub.
And this is a problem, because the sub itself is compiled *before* passing it as a parameter to presume().
Attached are some examples of how it doesn't quite do what you think it does:
- strict 'refs' is still strict, just when it fails, it gets eaten by eval ( x is 2 )
- strict 'vars' fatalises during compile time, so you have a compile failure before presume() ever gets called. ( commented out )
- warnings are compiled in at compile time, but their effects are only visible at runtime. ( yielding uninitialized value warning )
Hope that helps. =)
( I know acme modules are just for fun and learning things, so I figured maybe you were learning things, apologies if I'm telling you things you already know =) )
Subject: | presume.t |