General discussion

Locked

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

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| 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 ...

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

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?).

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums