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.


In reply to Re^2: Extending Perl::PIE - how to have Perl snippets executed ? by Anonymous Monk
in thread Extending Perl::PIE - how to have Perl snippets executed ? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.