Architecture of the openscript engine, Using perl on the brocade virtual adx, Perl variables – Brocade Virtual ADX OpenScript Programmer’s Guide (Supporting ADX v03.1.00) User Manual
Page 12

4
Brocade Virtual ADX OpenScript Programmer’s Guide
53-1003244-01
Using Perl on the Brocade Virtual ADX
1
Architecture of the OpenScript engine
Because script parsing is highly CPU-intensive it is performed entirely on the management
processor (MP) of the Brocade Virtual ADX. If the compilation succeeds on the MP, the script is
downloaded to the application processor (BP) for installation. The BP prepares the script by
generating machine byte code and binds it by inlining it in the packet processing path for the virtual
server and service. This process is displayed in Figure 2.
FIGURE 2
OpenScript compilation and installation process
Using Perl on the Brocade Virtual ADX
The Perl implementation on the Brocade Virtual ADX is based on Perl Version 5.12. It preserves the
core syntax and semantics of the core language as specified at the perldoc site:
http://perldoc.perl.org/5.12.4/perlsyn.html.
Perl variables
Perl variable scoping on the Brocade Virtual ADX
•
Any lexical variable declared as “my” within a script is re-initialized on every run. Variable
scoping is limited to the script it resides in. This means that variables are not visible to
other scripts.
•
A state lexical variable behaves like a C language static, with persistent value across
reruns. It is never re-initialized like “my”.
USB
OpenScript Engine
IPC
Compile
Script
Machine
Bytecode
Data Traffic
Control Plane
Data Plane
G
U
I
CLI
X
M
L
Preprocess &
Compile