Web Development

General discussion


Perl: Storing data inside a program

By MaryWeilage Editor ·
This week's Perl e-newsletter describes a method to store data inside the program source itself.

Will you use the __DATA__ or __END__ tags when you need to store data with your program? If not, what method will you use?

If you aren't alreadysubscribed to the Perl e-newsletter, visit our e-newsletter subcenter to sign up for this free TechMail today:

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Self-modifying Code (as in old hat)

by Hong Kong CIO In reply to Perl: Storing data inside ...


Nice trick - embedding the data segment inside of the program body. I seem to remember doing something like that in 1988 when doing my assembler course.

This technique used to be especially valuable when writing polymorphic viruses, by the way. Back in the old days when checksumming was a bit more primitive, moving bits of the payload around helped to evade detection.

Of course, you don't even need to have the __END__ tag. A search to EOF will probably do.

Anyway, nice example

Collapse -

by chouing In reply to Perl: Storing data inside ...

It reminds one of the READ and DATA statements in BASIC (or was it only in TI-BASIC?).

Related Discussions

Related Forums