Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

RE: RE:(2) Automatic CODE tags

by Corion (Pope)
on Jun 20, 2000 at 20:12 UTC ( #19050=note: print w/ replies, xml ) Need Help??


in reply to RE:(2) Automatic CODE tags
in thread Automatic CODE tags

Of course, there should be some more logic added, as most code that gets posted, won't compile. That's why it was posted in the first place. But then again, the analyzer should simply lean more towards code than towards text, because a monospaced text is far easier to read than vario-spaced and line-joined code.


Comment on RE: RE:(2) Automatic CODE tags
RE:(4) Automatic CODE tags
by swiftone (Curate) on Jun 20, 2000 at 20:16 UTC
    Of course, there should be some more logic added, as most code that gets posted, won't compile. That's why it was posted in the first place. But then again, the analyzer should simply lean more towards code than towards text, because a monospaced text is far easier to read than vario-spaced and line-joined code.

    I thought of that, but if you are taking it line-by-line (rather than whole post), any program of more than a few lines will have plenty of lines that compile.

    $var="bob";
    eval's, even if it doesn't do much. That's why I thought the code was so nicely elegant. You don't need much logic.

      I played around with the idea a bit yesterday night (the nights are really hot this time in .de :)), and here's a prototype that does some good formatting on my coding style. I don't know how well it works for other coding styles, and the implementation is a bit crude ... I couldn't get your elegant idea of "most single lines should compile" to work for me, so I resorted mostly to static REs - quite unelegant, as any such list is bound to be incomplete ...

      Anyway, if anybody wants to have a look at how a heuristic markup could be done, here's the code (the code is still a bit confused about CODE and PRE tags, but you should get the intention ...) :

      Update :D'oh - as soon as I go offline, I see many problems with the code. So here's an updated version ... Hmm - and I follow the suggestion and put the code into the Code Catacombs instead of posting it here ... The Code

        This is nice, but don't you think it really belongs in the Code Catacombs?

        The Perl Gods have said that the Perl interpreter is the best way to interpret Perl, so I'm still thinking that something that works with that would work better. After some testing though, I've discovered that the Safe Module will not do what I wanted. What we really need is the perl -c command function. I know nothing about the guts of perl, but there should be someway to access this. Do any of the Perl Gods have ideas?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-12-28 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (179 votes), past polls