Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

PHPS -> perl equivalent?

by simeon2000 (Monk)
on Jul 25, 2002 at 13:48 UTC ( [id://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 src_script.pl | perl pretty_code.pl > 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 filename.pl and edit mystyle.css to change the appearance of filename.htm +l. -nnn gives line numbers -pre only writes out <pre>..</pre> code section
    Cheers
    Update: Just tested it, and it does do syntax highlighting - not sure why I thought it didn't.
    davis
    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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-16 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found