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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.