If you add a __DATA__ section to the first script you'll see that it removes the error and allows the second script to be eval'd. Don't think there is a simple way to have an eval block extend the Data section.
But for the example you've given above, everything in the first script can be replaced by:
do 'test.pl';
In reply to Re: Losing __DATA__ when evaling script.
by Loops
in thread Losing __DATA__ when evaling script.
by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |