include different files at run time

Discussion in 'Perl Misc' started by rzhu, Apr 1, 2004.

  1. rzhu

    rzhu Guest

    Hi, Guys

    I'm a newbie in Perl, and I have this question for web development. To
    support different languages, I'm planning to extract all the text
    strings from the perl CGI code, and define them in different hashes in
    separate file. The idea is that at run time, depending on which
    language user select, I can load proper file, hence the proper hash
    for that language. Drop those strings into a static template HTML file
    (also grouped in different directories for different language). The
    ultimate goal is that to add support for a new language, I just have
    to create a new file, translate all strings in that hash, stick it
    into a new directory, and I'm done. No code mod needed.

    The question is, how do I do this in perl? It seems there is not a
    perl equivalent of ASP "include". Can anyone help?

    Thanks in advance.

    R. Zhu
    rzhu, Apr 1, 2004
    1. Advertisements

  2. rzhu

    Anno Siegel Guest

    I don't know what ASP "include" does.

    Look at Perl's "use", "require", etc.

    Anno Siegel, Apr 1, 2004
    1. Advertisements

  3. rzhu

    Tore Aursand Guest

    There are modules which helps you with this. Take a look at the Locale::*
    modules, specifically Locale::Maketext. Be sure to read the documentation
    before you dive into it.
    Tore Aursand, Apr 2, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.