Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
Some (semi-) random thoughts that might help:
  • If you can limit your language to only contain functions as the bodies of ifs, things should be easier
  • You could use a source filter or perhaps the CPP to translate ifdo expr function(args) to something like if(expr){function(1,args)}else {function(0,args)} and then use one or more of the Aspect:: modules to strip out the first arg and print an appropriate message. Or you could put a print in the else if that would be alright.
  • If you want to see the unexecuted code you could use a source filter to store it away and then print it out instead of deparsing it. That way you get the actual code.
  • You could write a translater from scratch to translate your language into perl and then run the result :-)

In reply to Re: Making my own control flow structure by traveler
in thread Making my own control flow structure by Anonymous Monk

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.