homepage Welcome to WebmasterWorld Guest from 54.166.84.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Help needed on language change
how can I add a folder in expression
fredfletcher



 
Msg#: 4361235 posted 1:35 am on Sep 12, 2011 (gmt 0)

Hello,

I'd really like some help on this.

How can I add the server's root folder of "english" to this:

~ s/_e\.shtml/_f\.shtml/

This 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 add the server's root of "french" folder in there.

For examples; and yes I know it's not right:

~ s/_e\.shtml/(French-Folder)_f\.shtml/

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.

Thank you.

 

janharders

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4361235 posted 9:42 am on Sep 20, 2011 (gmt 0)

If I understand you correctly, your filecontent is something like

<a href="myfile_e.shtml">
and you want it to be
<a href="/french/myfile_f.shtml">

right?
you need to include a way to match filenames. If, for example, you really are parsing links, you can use " as a marker.
s!"([^"]+)_e\.shtml"!"/french/$1_f.shtml"!gs
should work in that case.

If I didn't understand you correctly, please elaborate on exactly how your input looks like and what you want the output to be.
Sorry for the long time it took to get an answer, it seems everyone missed your thread.

fredfletcher



 
Msg#: 4361235 posted 4:21 am on Sep 29, 2011 (gmt 0)

pretty much yes. And then vice-versa once they're in the English folder and they click on the link (.pl) it brings them to the French folder respectively. I'll give it a try and let you know if it will work switching from one language to the other. Thank you

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved