[Israel.pm] attaching a big data section/file to a script

Roman M. Parparov roman at parparov.com
Sun Sep 13 23:06:22 PDT 2009

Yossi Itzkovich wrote:
> Hi,
> I have a script that needs a 400k (55k zipped) text file to come with it. The script reads this file in one of his modules.
> How can I "attach" the text file to the script ? 
Maybe you could use the __DATA__ directive?
'man perldata' is your friend in such a case.

> Another question: Can I encrypt it in some way, so only the script can "read/understand" it ?
> BTW: I intend to make the script an executable, if it matters to the answers.
I guess you're talking about a windows .exe file?

I think in such a case, and with embedded data, a simple transformation, like 
uuencode or a binary packing would be sufficient.

> Thanks for your help
> Yossi

More information about the Perl mailing list