in reply to Text storage/retrieval
One idea is to use the __DATA__ block to store texts
Why go through the process of having to convert text to a hash at runtime, everytime; and load all languages for every run.
text.EN
( "...", # 0 "...", # 1 ... );
And then you can do:
my $lang = determineLang(); my @text = do "$lang.pl"; ... print $text[ 27 ];
use Storable [thaw]; ... my $lang = determineLang(); my $text = thaw( "$lang.sto" ); ... print $text->[ 27 ];
You would use a separate small app to build and write the binary storable files.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Text storage/retrieval
by tobyink (Canon) on Mar 05, 2012 at 13:39 UTC | |
by BrowserUk (Patriarch) on Mar 05, 2012 at 14:09 UTC | |
by tobyink (Canon) on Mar 05, 2012 at 14:54 UTC | |
|
Re^2: Text storage/retrieval
by DreamT (Pilgrim) on Mar 05, 2012 at 13:32 UTC | |
by BrowserUk (Patriarch) on Mar 05, 2012 at 13:39 UTC |