The perl interface to polymake comprise all those functions and global variables that the subroutines in the production rule bodies are allowed to use.

$filename
The name of the data file.
$polyname
The name of a special file (socket) created by polymake server. It is usually passed to the client programs, where it is used as the filename argument of the Poly object constructor.
This variable can be also used as a stem for building temporary file names since it is unique among all simultaneously running polymake processes and always addresses a write-enabled directory.
$rulefile
The base name of the rule file where the current production rule is defined. Useful in diagnostic messages.
give ('request')
Returns the value of the requested property. It is always an array, with each element containing exactly one line with trailing newline character (\n). This array is always a copy of the original data, so it can be changed freely.
request is syntactically equivalent to the source of a production rule, that is, it can have alternatives or be weak. A request not matching any source of the rule is invalid and leads to immediate termination of the rule.
$given
Contains the name of the property returned by the last give call. If it was a weak request and no property could be found, this variable has undefined value.
take ('property', @data)
Stores the new value of a property. Elements of @data may contain separate or concatenated lines, in the first case with or without trailing \n. Empty lines are allowed, but discarded. Comment lines are recognized by the leading # character and stored apart.
The property must match one of the targets of the rule, otherwise the call is treated invalid and the rule immediately terminates. Note also that even a successful store request may be reverted later if the rule terminates with an error condition.
take ('property', \@data)
An accelerated version of the store request. It may be used only if @data is already in a valid internal representation: each data line is stored in a separate array element, has no leading whitespaces, and ends with a newline character (\n). Comments and empty lines are not allowed.
remove ('property',...)
Deletes the named properties. A rule can delete only properties listed in its sources.
client ('name', arguments)
Starts a client program. Has the same syntax as the standard perl system function. It makes some preparations providing the correct communication between the client and polymake server, therefore client programs started in any other way (via system or fork + exec) will inevitably fail.
inhibit ('class',...)
Denies the use of any rule belonging to the given classes, in the actual rule chain as well as in the possible alternative chains constructed after a failure.
@scratch
An array for intermediate data. When a rule execution starts, it is empty. All data stored in it are purged after the rule finishes. Before using its elements, a rule must initialize them by calling scratch_section.
Client programs can access it too, using property names of the form #index.
scratch_section ([number])
Reserves number elements (default: one) in the @scratch array and returns their indices.