On Wed, 2004-07-28 at 22:14, PerlDiscuss - Perl Newsgroups and mailing lists wrote: > I want to add some paths to the @INC array to resolve certain package > names at runtime. > > One of the methods is: "push(@INC,$path) or unshift($path,@INC)" and then > say "require package_name;". > the problem with this is that we still need to use the "::" operator with > the symbols to resolve the package namespace. > eg: package_name::test_sub(); >
Both of the examples that you give should do the trick, as will the pragma mentioned elsewhere: use lib $path; However, it seems to me that you want to be able to directly call some function within a package (ie. test_sub()) without having to prepend the package name and '::' separator. This is only possible if the package exports the subs into your namespace when use/require'd. See: perldoc Exporter HTH -- Joshua Colson <[EMAIL PROTECTED]> Giant Industries, Inc.
signature.asc
Description: This is a digitally signed message part