Accessing resources at run time with a Perl script
You might want to provide a script with the toolkit that users of the toolkit run. This script can access formatted strings from the toolkit’s resource bundle.
Procedure
Create a Perl script to access formatted strings from a
toolkit’s resource bundle.
Example
use strict;
use FindBin;
use lib "${FindBin::Bin}/../impl/nl/include";
use MyResource;
print MyResource::MY_TOOLKIT_MESSAGE_1("MyOperator"), "\n";
In this example, a Perl script is in the bin directory
of the toolkit top directory. The use lib
directive
is necessary to find the Perl module. There is a use
directive
for a module MyResource.pm
. The MY_TOOLKIT_MESSAGE_1
subroutine
is called to get the formatted string: