I believe the point he's trying to make is that you have to explicitly disallow subroutines that you don't want the user to be able to access directly from the interface. With the hash based inplementation, you have to explicitly allow a user to call a sub directly from the interface. Generally, a whitelist is much easier to maintain than a blacklist, with fewer reprecussions if you make an error when adding or deleting subs (i.e. if you forget to allow a sub the user needs it is less of a problem than if you forget to disallow a potentially dangerous sub). Consider what happens if the user types in "delete_user_by_name SomeUserIDislike" and it works.
There would be nothing keeping the user from winning in the case of the hash table, it just prevents the user from calling the "win" sub directly; Only the script can call that subroutine so the user must satisfy all the win conditions before they win.
--
Grant me the wisdom to shut my mouth when I don't know what I'm talking about.
|