Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
which tool may i use to make beautiful perl cgi web pages and then insert perl code where i want too?

Perl or no Perl, if you want beautiful pages you'll write them by hand (possibly using an editor with helps, such as cperl-mode in Emacs). The automatic page generation tools (Dreamweaver, Frontpage, Composer, and their ilk) invariably produce very messy code, code that's not maintainable, code that's needlessly bloated, code that's impossible for a human to read if you need to look at it to debug a problem, code that relies so extensively on physical markup (e.g., font tags) that you must abandon all pretense of accessibility, code that won't validate in a billion years, code that relies so heavily on browser quirks that when the next versions of the major browsers come out it will probably break and you'll have to redo it all. The advantages of these tools mostly involve people who don't know very much HTML being able to whip up a bunch of pages quickly. There's nothing beautiful about the results.

My advice if you want to make beautiful pages is to read one of the w3schools tutorials, which will take you all of an hour, get a text editor with good syntax highlighting and automatic indentation, and write the pages by hand. Bonus points if your editor will automatically insert the close tag together with the open tag; this helps greatly in keeping your code wellformed. Oh, and a graphic design course won't hurt, too.

As far as inserting the Perl code, there are two ways to go. You can use embperl, or you can make the whole page a Perl script, sticking the HTML in strings or HERE documents that the script prints. The latter approach is the one I use.

update: Templates are on my list of things I intend to evaluate; my recommendation should not be taken as advice against using templates.

$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

In reply to Re: a Couple of questions! by jonadab
in thread a Couple of questions! by Nik

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?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2022-12-05 12:23 GMT
Find Nodes?
    Voting Booth?

    No recent polls found