Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Ah, I'm glad someone's really putting it to the test. :) And yes, it does do better than VIM. :-p (You should see VIM choke on the relatively simple: qr ( one ( two ) three )x;!)

Regular Expressions are one of the weak points of the module. It's even listed under KNOWN ISSUES or LIMITATIONS (or at the mirror) in the documentation. I may add support for regexp-special characters later, and maybe even set it up to handle the /e option. The big problem with the /e option is that it requires back-tracking (see my recent reply).

I tried to show off, in the Test file, some of the tricky constructs that the formatter handled correctly. Especially that funky here-doc stuff at the bottom. :) Note that VIM doesn't even handle formats at all. All in all, I've tried to make it as true to Perl as I could (without actually parsing the code!). Considering I just shatter the string with a heavy regexp (or 10) and then walk through the pieces, I'm surpised I got it working this well! :D

Thanks for the tip on a2ps! I originally started writing this module because I didn't know of anything that would highlight Perl code for presentation-or-printing. I wanted to be able to really show off my code on the web so I started working.

I looked through the home page for a2ps and it looks nice. Very versatile as far as languages it handles, though I think that limiting it to PostScript output makes it not as good for my orignal purpose (of converting code to HTML). Do you know of a PS to HTML filter? I certainly never plan to extend my formatter to handle languages other than Perl (people use languages other than Perl???) so I think a2ps will always beat me out in that respect. :) I didn't install it to try it out so I don't know how well it handles some of the more esoteric constructs of Perl. It certianly looks powerful enough to do a good job!

Well, thanks again for your reply, and let me know if you get a chance to delve into the depths of the module and can offer any suggestions for improvement!

bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.


In reply to (bbfu) (tested code) Re: Re: Seeker of Perl Code Review by bbfu
in thread Seeker of Perl Code Review by bbfu

Title:
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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-24 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found