Discussion Locked

Perl: Storing data inside a program

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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:
http://builder.com.com/techmails.jhtml?repID=u001

2 replies

by hong kong cio

Hello,

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

by chouing

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

This discussion is closed to new replies.