Octavian,
Thanks for the reply.
>> So I tried the following:
>> use lib "ss_files";
>> This also works, but iirc, I read that it won't work across all platforms.
>> Is that correct?
>
>
> This method also works, but to be equivalent with the first method it should
> have been:
> use lib "../ss_files";
Actually, that doesn't work. Adding "../" breaks the script.
> If you change the current directory to be another directory, like /home/user
> for example, it won't work, because it will search for modules in
> /home/ss_files.
The directory won't change once the script is installed. Both shop.cgi
and the ss_files directory are in the surfshop directory and will always remain
there. The surfshop directory could, in theory, be placed anywhere, but that
shouldn't have any effect on shop.cgi calling the other files, no?
If that's the case, I like use lib "ss_files"; simply because it's
short and sweet. If no one knows of a problem with portability, then I'll
stick with it. I just don't want someone to download our cart and then have a
problem with it simply because I wasn't able to test it properly.
Thanks again,
Frank
SurfShop v1.5.2 Released
http://www.surfshopcart.com/forrumm/viewtopic.php?f=2&t=298
-----------------------------
For the sake of completeness, I ran across another way to locate files
in a sub-directory here:
http://learn.perl.org/faq/perlfaq8.html#How-do-I-add-the-directory-my-program-lives-in-to-the-module-library-search-path-
BEGIN {
use Cwd;
our $cur_directory = cwd;
}
use lib "$cur_directory/ss_files";
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/