On Mon, 9 Aug 1999 11:54:29 -0400, Ronald J Kimball wrote: >use Module is documented to be exactly equivalent to > >BEGIN { require Module; import Module } > >I'm skeptical that anything could be done with use that could not be done >with require/import. We were all focussing one the "import" part. But even without that, use() is different than require(). Here's an example. sub test { local $" = ", "; print "Testing @_.\n"; } test 1,2; This prints: Testing 1, 2. Try moving the sub to following the sub call, and it won't compile. Why? Simply because of the fact that the compilers hasn't seen the definition for sub test, so the statement looks like a syntax error. Now move a sub into a file, called "Test.pm". Add the line "1;" at the end. Place the file reachable through a directory in in @INC. Do: require Test; test 1,2; It won't compile. Replace it by use Test; test 1,2; And not only WILL it compile; it will run, too. This does work too: BEGIN { require Test; } test 1,2; QED. The BEGIN block (which is implied with "use") may be necessary, simply for the rest of the script to compile. Bart. ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org