Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Logging run-time warnings from an embedded perl interpreter

by Hercynium (Hermit)
on Nov 25, 2007 at 15:50 UTC ( #652836=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Logging run-time warnings from an embedded perl interpreter
in thread [RESOLVED*] Logging run-time warnings from an embedded perl interpreter

actually, it's just there so that the application can 'see' those vars when validating the code, before storing it for later execution.

What appears to be happening with this app is that a persistent perl interpreter is running, and then user-defined 'snippets' of code are evaluated within that interpreter when an SNMP event happens. There are certain variables made available to the user for use within those code snippets, created and set at run-time somehow by the app. However, when you turn on strict within the snippet, using those vars results in a validation error. Hence my use of the (admittedly icky) construct.

For data that I wish to persist between code evaluations I've been using our %VAR = () unless %VAR; which works as expected, though it still feels icky. The app gives no ready mechanism for initialization of anything at startup, and my experiments with BEGIN blocks have been less than encouraging.

Anyhow, I appreciate the advice! Perhaps someday I'll find the time to develop an app that can compete with this monstrosity and force the developers to actually make it usable for a change :)


Comment on Re^4: Logging run-time warnings from an embedded perl interpreter
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://652836]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (16)
As of 2014-11-25 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (158 votes), past polls