in reply to Re^2: Subroutine references inside of a hash with arguments.
in thread Subroutine references inside of a hash with arguments.
Strict is a compile time thing - not run time. Scoping like "my vars" is a big part of what "use strict" enforces - use of a fully qualified name in another module is completely within the "rules of strict".
I would highly recommend Randal Schwartz'es book, "Effective Perl Programming", see item 36. For example to learn more about -w, see page 143.
I don't think we need to get into a big brouhaha about legalistic sounding terminology about "discouraged" vs "deprecated". Suffice it to say that neither of us would recommend old style &sub() over just sub() for new code.
I didn't explain var passing very well, fair enough. I can write an article about this if there is enough interest. There are limits to what can be explained in a short post. And there are some extremely complex things that have to do with this. But yeah, in general when you call a sub, you push things onto a stack and the sub consumes them by shifting them off the stack, just like with any other main programming language, C, C++, JAVA, etc. Yes, there are things that are different things about say how C and C++ and Perl does this, but these are details. The basic "model" about how to send stuff to a sub and get stuff back is the same.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Subroutine references inside of a hash with arguments.
by chromatic (Archbishop) on Jul 25, 2009 at 17:55 UTC | |
by Marshall (Canon) on Jul 27, 2009 at 18:41 UTC | |
Re^4: Subroutine references inside of a hash with arguments.
by Anonymous Monk on Jul 25, 2009 at 09:17 UTC | |
by Marshall (Canon) on Jul 25, 2009 at 09:28 UTC |