Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re^2: On-the-fly all-languages syntax highlighting

by SavannahLion (Pilgrim)
on Dec 17, 2003 at 06:16 UTC ( #315227=note: print w/ replies, xml ) Need Help??


in reply to Re^2: On-the-fly all-languages syntax highlighting
in thread On-the-fly all-languages syntax highlighting

Using B (probably with some backend such as B::Terse, I can't imagine you want the bare B module) would only be a security issue if you want to highlight code submitted to your site by anyone, and that's not because of B itself so much as because using B requires Perl to have compiled the code, which is inseparably connected with the possibly of having code run at compile-time.

That's exactly the problem I'm worried about. The site is open ended and allows text to be uploaded. I mentioned B since I saw that it appeared to have some C specific routines that might be utilized for what I want. I toyed with that idea for all of 40 seconds when I realized that B is ultimately designed to compile C and that someone might be able to invoke the compiler through some bug somewhere I wasn't aware of. A risk I didn't want to take.

About Text::VimColor. I looked over the documentation for Text::VimColor and I don't think this is a viable alternative for my needs. The wya I figure it, I suppose I could get away caching the output (I already have stubbed code for exactly that sort of thing), but am I correct in understanding that this module utilizes Vim?

-----
Is it fair to stick a link to my site here?

Thanks for you patience.


Comment on Re: Re^2: On-the-fly all-languages syntax highlighting
Replies are listed 'Best First'.
Re^4: On-the-fly all-languages syntax highlighting
by Aristotle (Chancellor) on Dec 17, 2003 at 10:01 UTC

    B is ultimately designed to compile C and that someone might be able to invoke the compiler through some bug somewhere I wasn’t aware of.

    Uh… not exactly. B has nothing to do with C compilation, and even B::CC has no code to invoke a compiler.

    What I was referring to is BEGIN blocks, use, and the like.

    Makeshifts last the longest.

      Uh.. not exactly. B has nothing to do with C compilation, and even B::CC has no code to invoke a compiler.

      . Oh, OK, I think I understand now. When I read,

      This compiler backend takes Perl source and generates C source code corresponding to the internal structures that perl uses to run your program. When the generated C source is compiled and run, it cuts out the time which perl would have taken to load and parse your program into its internal semi-compiled form.

      That put me under the impression that it generated and compiled C code. I kept wondering about that blurb near the bottom about "some compilers." I just didn't put two and two together, my bad.

      ----
      Is it fair to stick a link to my site here?

      Thanks for you patience.

Re: Re: Re^2: On-the-fly all-languages syntax highlighting
by Anonymous Monk on Dec 17, 2003 at 08:29 UTC
    but am I correct in understanding that this module utilizes Vim?

    From Text::VimColor docs:

    Text::VimColor - syntax color text in HTML or XML using Vim

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2015-07-28 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls