|
|
| There's more than one way to do things | |
| PerlMonks |
Re^4: Evaluating subroutines from within databy Lady_Aleena (Chaplain) |
| on Jan 09, 2012 at 01:49 UTC ( #946934=note: print w/ replies, xml ) | Need Help?? |
|
Actually, it didn't. I don't see how to incorporate that into the following. print_definitions will not be the only subroutine that I may want to parse from within the __DATA__ of a document which is being parsed by print_story. The very first line is confusing with the two hyphens you put after the shebang. I looked at Safe, and don't understand what the big deal is, since all blocks to me are separate compartments of code to begin with. I take it that $str is equivalent to __DATA__ in your example. I have no idea what my $namespace = __PACKAGE__; is doing. I see you created a dispatch table, but it appears empty of anything that looks like what I'm trying to do. print_story is the subroutine I've used the most throughout my site. You've latched onto print_definitions when in the future there could be print_table, print_list, print_monster, print_books, and more. I'd like to put them in __DATA__ when I want to include them within the body of my text.
If you could point me to a few perldocs to explain some of what you did and how to incorporate it into print_story I'd be grateful. Have a cookie and a very nice day!
Lady Aleena
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||