in reply to Re: Using relative paths with taint mode
in thread Using relative paths with taint mode
As of Perl 5.26, the current directory isn't in @INC any more, regardless of taint mode
So, I am getting the point that taint, and later versions of Perl are trying to make it difficult to use relative paths for modules!
This raises a different question...
Where should the modules be located?
If there was just one 'version' or environment of the website then it would be easy to just put them somewhere above the website root in the filesystem. I do this with modules that are common to all my websites. But there are always 2 and sometimes 3 different environments for every website. Production, test and sometimes development.
/home/myusername/somewebsite/prod/cgi-bin/Site/ /home/myusername/somewebsite/test/cgi-bin/Site/ /home/myusername/somewebsite/dev/cgi-bin/Site/
Having the modules in a relative path allows them to be logically separated in each of the environments and to be developed and tested before being released into production.
Is the solution to locate the modules above the website root with a different subfolder for each environment?
/home/myusername/somewebsite/prod/cgi-bin/ /home/myusername/somewebsite/test/cgi-bin/ /home/myusername/somewebsite/dev/cgi-bin/ /home/myusername/somewebsite/perlmodules/prod/ /home/myusername/somewebsite/perlmodules/test/ /home/myusername/somewebsite/perlmodules/dev/
I tried this for template files on the first site I created using Template. It was a bit messy to maintain so instead, for future projects, I have stored the templates in under the webroot but protected from HTTP access by putting an index.html file in the directory which sends the user to the homepage.
Is there a better way to handle this issue - what is the accepted norm for locating Perl modules on a webserver where there are multiple sites and multiple environments within each site?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using relative paths with taint mode
by hippo (Archbishop) on Jun 20, 2021 at 14:43 UTC | |
|
Re^3: Using relative paths with taint mode
by haj (Vicar) on Jun 20, 2021 at 15:07 UTC | |
by Bod (Parson) on Jun 20, 2021 at 15:47 UTC | |
by haj (Vicar) on Jun 20, 2021 at 17:56 UTC | |
by Bod (Parson) on Jun 21, 2021 at 22:45 UTC | |
by haj (Vicar) on Jun 22, 2021 at 12:52 UTC | |
| |
by afoken (Chancellor) on Jun 24, 2021 at 07:55 UTC | |
|
Re^3: Using relative paths with taint mode
by marto (Cardinal) on Jun 20, 2021 at 14:04 UTC | |
by Bod (Parson) on Jun 20, 2021 at 14:22 UTC | |
by marto (Cardinal) on Jun 20, 2021 at 14:30 UTC | |
by Bod (Parson) on Jun 20, 2021 at 14:29 UTC | |
by marto (Cardinal) on Jun 20, 2021 at 20:11 UTC |