Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Re: Pointers on working with another language's syntax

by jonadab (Parson)
on Feb 18, 2003 at 13:30 UTC ( #236246=note: print w/replies, xml ) Need Help??

in reply to Re: Pointers on working with another language's syntax
in thread Pointers on working with another language's syntax

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

Replies are listed 'Best First'.
Re: Re: Pointers on working with another language's syntax
by tall_man (Parson) on Feb 18, 2003 at 15:45 UTC
    You could get the same effect with "here" documents, i.e. "<<EOF" style. That way you could continue to mix perl and Inform code and gain more points for obfuscation.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2023-12-02 11:14 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (16 votes). Check out past polls.