Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thanks again Zaxo,
I ran a test using this, however, the $eval fails on me (in a browser I get Error 500)...

I use logging in the scripting to catch errors as well as MySQL calls (and anything else I choose to log). The log shows the following when the script is executed:

Sep 26, 2005 (10:49:52) : ERROR SITUATION: Interface Crash, error message:
syntax error at Main/Menu.pm line 101, near "$_::runonce(" Compilation failed in require at d:\PROGRA~1\APACHE~1\apache\cgi-bin\intern2.cgi line 31.

In the file Main/Menu.pm I have your code as:
sub sub_menus { for (keys %INC) { next unless m/^Main|Addins/; s!/!::!g; s/\.pm$//; #print "<font face=\"Arial\" size=\"2\">$_<br></font>\n"; eval { $_::runonce() }; } }
The function, runonce (sub runonce), is available in exactly one file. Perhaps I shouldn't use sub, rather someother addressing scheme that I'm unawear of?

If I comment out the eval line and use the print line, execution runs clean (with the exception of runonce not running).

I assume the problem lye with the logging I have to catch problems and log them:
$SIG{__DIE__} = \&error_crash_trapper; $SIG{__WARN__} = \&warn_crash_trapper;
Is there any other way to achieve this? Essentially I'm looking for simplicity and the use of a 'dummy' routine that doesn't rely on hard coded information which then allows for dynamic implementation.

In reply to Re^4: Same function multiples unknown modules by Delusional
in thread Same function multiples unknown modules by Delusional

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found