Hi,
I guess it would be too much to include code. You can find Perl::Pie here :
http://www.pre-emptive.net/doco/pie-perl-inference-engine
The problem is that I do eval from Perl::PIE package extensions and it doesn't work, while it works in main program when used directly without eval...
Small Example:
main program:
...
use Pie::KnowledgeBase;
use Pie::Engine;
use Pie::KnowledgeBase::Dumper;
use Data::Dumper;
require 'time_utilities.pl'; # For misc. functions (e.g. time/da
+te stamp routines)
use Time::HiRes('gettimeofday');
use vars qw($Time $Second $Minute $Hour $Mday $Wday $Day $Month $Year)
+;
...
then I have somewhere in Perl::PIE
packages snippet:
...
print " ----------------- " . $ref->{attribute} . "\n"
+;
...
where $ref->{attribute} includes string to print that is defined in xml config :
<rule name="print status every 5 secs">
<condition attribute='main::new_second(5)' type="time" trigger="1">
+1</condition>
<action attribute="\n****************print status every 5 secs: New
+_Second: Weekday:$Wday Time:$Hour:$Minute:$Second Time_Now:$Time_Now
+Date:$Mday/$Month/$Year" type="print">1</action>
</rule>
and I don't get variables substituted in printed text by their value, so I get exactly literally the same string back :
"\n****************print status every 5 secs: New_Second: Weekday:$Wday Time:$Hour:$Minute:$Second Time_Now:$Time_Now Date:$Mday/$Month/$Year"
What should I do to print real values of variables and not literally their names ?
Thanks in advance,
Rob.
|