in reply to Evaluating subroutines from within data
I discussed this a while ago in the chatter box, but I can't remember what was suggested.
Do you remember what you asked?
I've read your question four times, and the closest I've seen you come to a question is in the middle :)
I've tried preceding the line with a & and then using eval. The only way that it would work is if I used the full name of the subroutine, which in this case would be Base::HTML::print_definitions(). In the future I may want to print a list of links or use another subroutine I am writing for printing tables. I really don't want to have to use the full names of each subroutine which is part of the textThe following is the code for both print_story and print_definitions which prints the results I expect by themselves. However, I just haven't figured out the best way of getting them to work together. start_html and end_html are the templates I use on every page of my site. The line subroutine just adds tabs to the beginning of a line and then prints a newline after the line. get_hash does what it says, it gets a hash from a data file.
So you want to combine these fragment to do something, but your attempt to use eval to print_definitions isn't quite the best way ....
You you almost have self-contained runnable code, you have some input data, what output do you want to produce?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Evaluating subroutines from within data
by Lady_Aleena (Priest) on Jan 07, 2012 at 06:24 UTC | |
by Anonymous Monk on Jan 08, 2012 at 07:41 UTC | |
by Lady_Aleena (Priest) on Jan 09, 2012 at 01:49 UTC | |
by Anonymous Monk on Jan 09, 2012 at 02:32 UTC |