good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Over on on another thread, I got my wrist slapped* by kcott for using Indirect Object Syntax. I have read the linked documentation and its warnings and I am not sure I totally understand. So I am hoping some wise Monks will help with clarification. The offending code I posted was: As I read the documentation, the problem is that the Perl interpreter has difficulty knowing whether I mean: or (&new used to make it clear it is a subroutine!) and because Perl's interpreter could potentially get this wrong, so could any human trying to understand the code. Is that about right??? A secondary question that follows on... Does this mean that a constant piece of code, such as a module, could behave very differently depending on context? For example, if the same module were utilised in two different scripts? And what about between different versions of Perl. Could code behave differently depending on the version of Perl? * Just to be clear, it was a very welcome wrist slapping from kcott - I am here to learn and hopefully help others. I am always very grateful when my mistakes are pointed out as it allows me to improve my skills. In reply to Indirect Object Syntax by Bod
|
|