executeperlscript
SOURCE
,
RESULT
,
FOLDER
,
TIMEOUT
The executeperlscript statement executes Perl code.
Parameters
This statement has four parameters:
source – Perl source code.
result – script output sent to stdout.
folder – folder to execute Perl script in (default to current database folder)
timeout – Timeout in seconds (default is 60 if not supplied).
Description
This statement executes a Perl script. Using special tags, the script can access formulas that use Panorama fields and variables (including local variables). (The formulas are actually calculated in advance, then substituted into the Perl code as constants.)
To embed a Panorama formula that has a text result into the Perl code, use this syntax:
"«formula»"
To embed a numeric formula, use this syntax:
#«formula»#
Here is a silly example that displays the time (of course this could be done from within Panorama, without using Perl).
local pr
executeperlscript |||print "Hello from Panorama "«timepattern(now(),"hh:mm:ss am/pm")»"+“\n"|||,pr
message pr
Note: This statement has been superceded by the perl statement and perl( functions. Use these for new applications.
See Also
- applescript -- executes an AppleScript.
- applescript( -- executes AppleScript source code and returns the result.
- executeapplescript -- compiles and runs an AppleScript.
- executesudounix -- executes a UNIX shell command using *sudo* (root) privileges.
- executeunix -- executes a UNIX shell command.
- perl -- executes a Perl script (program).
- perl( -- executes a perl program and returns the result (stdout).
- php -- executes a PHP script (program).
- php( -- executes a PHP program and returns the result.
- python -- executes a Python script (program).
- python( -- executes a python program and returns the result (stdout).
- ruby -- executes a Ruby script (program).
- ruby( -- executes a ruby program and returns the result (stdout).
- scriptbglog -- specifies a path/file for output from STDOUT from embedded programs run in the background (Perl, Ruby, Python, PHP).
- scripttimeout -- sets the maximum runtime allowed for an embedded program (AppleScript, ShellScript, Perl, Ruby or Python).
- shellscript -- executes a UNIX shell script.
- shellscript( -- executes a UNIX shell script and returns the result.
- usebashprofile -- grabs the search path from the `.Bash_profile` file in the user's home folder, so that these paths will be used by scripting languages (*Ruby, Python*, etc.).
History
10.0 | No Change | Carried over from Panorama 6.0. |