I'm playing with patching the perl source and am attempting to create a new super global variable for nefarious purposes. I've added the following code to one of the opcodes in pp_ctl.c:
SV* super_i;
super_i = get_sv("main::buu_test_i", TRUE);
SvIV_set(super_i, 42);
Which *seems* to work properly. Unfortunately once I compile I can't seem to access my new variable from perl code. That is, when I try to print out what I think is the variable I just set I get undef. Do I need some special magic to make it accessible from perl, or do I need a specific perl command to invoke it? (I've tried $buu_test_i, $main::buu_test_i, and so on).
-
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.
|