in reply to Re^9: Wassercrats::Improved Volume 0, Number 0
in thread Perl::Improved Volume 0, Number 0

Unless variables and functions share the same namespace and syntax (as in the case of lvalue methods), functions are different in that they also encapsulate behavior. Variables merely encapsulate values.

  • Comment on Re^10: Wassercrats::Improved Volume 0, Number 0

Replies are listed 'Best First'.
Re^11: Wassercrats::Improved Volume 0, Number 0
by ysth (Canon) on Aug 27, 2004 at 06:56 UTC

      But what else is a tied variable but a variable hidden behind, and accessed by, several functions? It is just syntactic sugar (yes I am simplifying it a bit). Much of the same goes for overload, do something with a variable, and a function is called behind the scenes.

      -stvn

        Yeah, but the point is that variables can also encapsulate behaivor, and variables can also occupy a heirarchy of namespaces. So, a "global function" really isn't any better than a "global variable". They're both just globals.