I recently posted a question about accessing a .dll file to retreive some resource information. One of the suggestions for that was to look at
Win32::Resources. I have taken a look at that module, but I am confused on how to access the data I need. Here is the sample code I have tried to use.
use strict;
use Win32::Resources;
my $filename = "C:/path/to/file.dll";
my $data = Win32::Resources::LoadResource(
filename => $filename,
type => 'STRING',
name => '1',
language => '0'
);
print "$data\n";
The .dll file I am trying to access has 43 resource entries that are structured like the following:
STRINGTABLE
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
1, "foo"
2, "faz"
3, "far"
4, "bar"
5, "baz"
6, "boo"
7, "abc"
8, "def"
9, "ghi"
10, "jkl"
11, "mno"
12, "pqr"
13, "stu"
14, "vwx"
15, "yz1"
}
When I change the name field in my code between 1-43 $data has data written to it. When I go above 43 it is uninitialized. So it seems that the data I am looking for is getting written into $data. However when I print $data it seems to be just garbled data. Not the text information I was looking for. I am sure I am missing something easy, but from the module documentation i was not able to determine what it is. Any suggestions?
Thanks!
-Prime