Next: Accessing base data Previous: Sharing data between active parts Contents: Contents |
PerlPoint variables are no active contents. Even when active contents is disabled completely, variables will still work. Nevertheless, their values are copied into the namespace of active contents.
That means you can read every PerlPoint variable in active parts.
$var=10 The variables value on PerlPoint side is $var. On Perl side, it is \EMBED{lang=perl}$main::var\END_EMBED as well. |
Note that the variables are only copied. They may be modified on Perl side but without effect to PerlPoint.
$var=10 The variables value on PerlPoint side is $var. On Perl side, it is \EMBED{lang=perl}$main::var*=100\END_EMBED now. But this does not affect PerlPoint which still sees a value of $var. |
Further more, whenever a variable is set on PerlPoint side, the Perl side value is updated which overwrites all modifications eventually made.
You may have noticed that the variables were accessed by their fully qualified names in the examples above. This was done because PerlPoint variables are evaluated first - before the code is passed to perl. By using the fully qualified name which is unknown to PerlPoint this replacement is suppressed. Alternatively, $var
may be written.
Next: Accessing base data Previous: Sharing data between active parts Contents: Contents |