Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

PHPS -> perl equivalent?

by simeon2000 (Monk)
on Jul 25, 2002 at 13:48 UTC ( #185193=perlquestion: print w/replies, xml ) Need Help??

simeon2000 has asked for the wisdom of the Perl Monks concerning the following question:

One of the neat features of the OTHER language that is good at handling the CGI environment (PHP), there is a feature where if you set up apache right, and set a file with a .phps extension, it will show the source code with syntax highlighting through html.

Is there anything like this for our beloved perl? If, let's say, I want to showcase some code, is there a code beautifier (or just syntax highlighting really) script for example? Something like:

cat | perl > src_script.pls

Surely this has been done... for what better language to parse perl than... perl? :E

"Falling in love with map, one block at a time." - simeon2000

Replies are listed 'Best First'.
Re: PHPS -> perl equivalent?
by davis (Vicar) on Jul 25, 2002 at 14:04 UTC
    Check out perltidy - from perltidy -h
    -html write an html file (see 'man perl2web' for many options) Note: when -html is used, no indentation or formatting are do +ne. Hint: try perltidy -html -css=mystyle.css and edit mystyle.css to change the appearance of filename.htm +l. -nnn gives line numbers -pre only writes out <pre>..</pre> code section
    Update: Just tested it, and it does do syntax highlighting - not sure why I thought it didn't.
    Is this going out live?
    No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist
Re: PHPS -> perl equivalent?
by mkmcconn (Chaplain) on Jul 25, 2002 at 19:27 UTC

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://185193]
Approved by broquaint
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2023-03-29 07:55 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (70 votes). Check out past polls.