in reply to Strict, strings and subroutines
The no strict 'refs'; suggestion, while the easiest to implement (you just put a block around the call and add no strict 'refs'; at the top) ... it doesn't solve the issue. All you end up doing is patching around the problem. strict is, well, strict ... for a reason.
The eval suggestion, while canonical, is, in my opinion, also a patch. eval is extremely powerful, but it doesn't give you the greatest amount of control over what's happening. There are a number of cases where you would have to use it, cause there simply isn't any other sane way to do what you have to do. But, if you can do something in a sane and maintainable manner that doesn't use eval, I'd suggest doing that. eval is one of the less-understood features of Perl. The poor schmuck who has to read your code after you're hit by that truck will remember you fondly if you try to minimize his/her learning curve. :-)
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
---|