I would put the Inform code after a __DATA__ statement and then read the Inform code
Brilliant! Why didn't I think of that?
into a hash-structure (or more likely a hash of hashes of
Yes, it will need to be a nested structure.
Something like
$datum{$objectname}{$propertyname}=$propertyvalue;
$datum{$objectname}{$attributename}=(($attr)?1:0);
As an added bonus, this way of doing it will allow
me to give the Inform objects hardware short names,
declare their parents, and so on. Simply wonderful.
The only downside is, this prevents me from putting
a bunch of Perl code at the end as I was doing, but
I can live with that restriction.
sub H{$_=shift;while($_){$c=0;while(s/^2//){$c++;}s/^4//;$
v.=(' ','|','_',"\n",'\\','/')[$c]}$v}sub A{$_=shift;while
($_){$d=hex chop;for(1..4){$pl.=($d%2)?4:2;$d>>=1}}$pl}$H=
"16f6da116f6db14b4b0906c4f324";print H(A($H)) # -- jonadab
-
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.