in reply to Re: Evaluating subroutines from within data
in thread Evaluating subroutines from within data
The following is a sample of what I want to be able to do.
#!/usr/bin/perl use strict; use warnings FATAL => qw( all ); use CGI::Carp qw(fatalsToBrowser); use lib '../files/perl/lib'; use Base::HTML qw(print_story print_definitions); print_story(*DATA,1); __DATA__ Paragraph that opens the document. 2 Heading for definition list This is the paragraph that precedes the definition list. &print_definitions( file => "some_file_a.txt", headings => ["term","de +finition"],) This is the paragraph that follows the definition list. 2 Heading for next definition list This is the paragraph that precedes the next definition list. &print_definitions( file => "some_file_b.txt", headings => ["term","de +finition 1","definition 2"],) This is the paragraph that follows the next definition list. 2 Heading for the close of the document The paragraph that closes the document.
In print_story I would like to have something simple like, but I doubt it will be that simple.
elsif ($line =~ /^\&/) { eval($line); }
Have a cookie and a very nice day!
Lady Aleena
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Evaluating subroutines from within data
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 |
In Section
Seekers of Perl Wisdom