Help on Adding a sub-folder in script
I'd really like some help on this, a PERL-CGI script (complete working script is below).
How can I add the server's root folder (folder_f) to this:
This bit of code searches all occurences of _e.shtml and replaces them with _f.shtml (it being in the same folder).
Yet, in between that, I would like to be able to add the server's root of "folder_f" folder in there, or done another way if it has to.
My script is called "change-language.pl" - which has a hyperlink to it in "file_e.shtml". When clicked, it will try to find the file "file_f.shtml".
For example of what I would like it to do:
~ s/_e\.shtml/(FOLDER_F)_f\.shtml/ (found in script below, but I added (FOLDER_F).
I tried: $calling_page =~ s/_e\.shtml/'s/^/$.\f'\/_f\.shtml/;
but it did not work. It brings me to the same _e.shtml file.
I would really appreciate anyone's help on this one, as I can't seem to get it right, with what I know so far.
The complete script is below, which works but only if both language files (file_e.shtml and file_f.shtml) reside in the same folder. I need to be able to have the script work, so that it will find the file (file_f.shtml) but in a different sub-folder on the server's root called "FOLDER_F" folder.
In the part $calling_page =~ s/_e\.shtml/_f\.shtml/; of the script, is there a way to do this:
$calling_page =~ s/_e\.shtml(FOLDER_F)/_f\.shtml/; - FOLDER_F being in parentheses is where I would like to be able to have the script modified so that it goes to a sub-folder and get file_f.shtml in FOLDER_F sub-folder.
What I have so far follows WORKS, but only works if both _e.shtml and _f.shtml files are in the same folder:
|All times are GMT +5.5. The time now is 06:22.|