rellaboyina has asked for the wisdom of the Perl Monks concerning the following question:

Dear All,

I want to display the content of a file which I will be exporting to the module Locale::Maketext::Lexicon. For example there is a file "/abc/cde.po" and I wan to access this file using the above module.

Please let me know how to display the content of the file where as I am using the CGI environment.


SSS.pm
package SSS; use lib '../lib/perl-5.8.3/lib/site_perl'; use base Locale::Maketext; use Locale::Maketext::Lexicon { '*' => [Gettext => '../abc/*.po'], _auto => 1, _style => 'gettext', }; use strict; 1;
I use this module inside my CGI file as follows:

program.cgi
use CGI; use SSS; my $q = new CGI(); my $sf = pot::SF->new; # pot::SF is a user-defined module my $lang_to_use = get_lang($q->http('Accept-language'), $sf->{LANGUAGE +S}) ; $lang_to_use = $sf->{LANG_DEFAULT} if (!defined($lang_to_use)); my $lh = SSS->get_handle($lang_to_use);

Once we get the file handle $lh for SSS.pm, how do we display the content of the file.

Thanks in advance.

Replies are listed 'Best First'.
Re: How to display the content of a file
by superfrink (Curate) on Nov 07, 2007 at 17:20 UTC
Re: How to display the content of a file
by Anonymous Monk on Nov 07, 2007 at 11:11 UTC
    open/read/print