Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

HTML embedded in CGI

by FiReWaLL (Scribe)
on Jul 24, 2000 at 21:34 UTC ( [id://24133]=perlmeditation: print w/replies, xml ) Need Help??

There are sure manyways to get html from other files to use in a CGI program, but when you want to build a single-file software, how big it gets with the HTML inside? My programs grow like from 4, 5K to 100, 200K, and I keep making things to make HTML occupy less bytes and less lines too. So my html codes have a lot of \n and \t in the program and you realy can't understand what's in there, but when you open a source code in the browser it looks perfect...

Replies are listed 'Best First'.
RE: HTML embedded in CGI
by TQuid (Sexton) on Jul 24, 2000 at 22:31 UTC
    I know this is a Meditation, but you sound like you're saying you're putting in a lot of possibly unnecessary effort.

    You might check out something I have found very handy lately, HTML::Template. It separates out the HTML from your Perl in a reasonably elegant way, without being a wholly different system like Mason or embPerl.

    --TQuid

      I know that there are many ways to Seperate HTML from code, I have several myself (Although I didn't knew these packs, I'll look at it, thanks! ^_^) but the thing is, you noticed how much you spend to make the user happy? The software, the thing that makes everithing work is about 5K. (If you make a 5K software (NO HTML), it can make a lot of things), and you need more 500K to make the user happy.

      Once, a client complained that "the bank was too big", and it was making "the page get slow". I made a query thru telnet, it took 30ms to answer, and I got into the site: In the midle, the database query, and around it. I could see 45 Images.

      Figure why the site was slow? ^_^


      ---
      The only thing you regret in life, is the risk you don't take.

      The Template Toolkit won the "Best New Module" award at TPC last week. It's well worth checking out for this kind of thing. The website includes the slides from the presentation that Andy Wardley gave at the conference.

      --
      <http://www.dave.org.uk>

      European Perl Conference - Sept 22/24 2000, ICA, London
      <http://www.yapc.org/Europe/>
RE: HTML embedded in CGI
by JP Sama (Hermit) on Jul 24, 2000 at 23:18 UTC
    Well, "i believe in gnomes! but i've never seen one!!!" *gg*
    What i am triyng to say, with the stupid joke is: There are things in life, that we cannot do absolutely nothing to change!
    As hard as you try, you'll only be able to minimize your code to 90% of the total... and if you try really HARD!

    sorry about the comment...
    'cause i believe that comments like this, are the ones that desistimulates people to complete their dreams, and concretize their ideas!! - just don't give up 'cause of this!!

    #!/jpsama/bin/perl -w
    $tks = `mount`;
    $jpsama = $! if $!;
    print $jpsama;

      I'll start do zip the HTML and unzip to each user... then I'll get it 90% smaller... **grin**

      The only thing you regret in life, is the risk you don't take

        or you could make a sub to change the code, changing small personal tags, for the html tags with table formats, and stuff! :)
        ex: <t>.</t> for <table width="100% bgcolor="#FFFFFF" cellpadding="0"> +.</table>

        muahahahahaaha!!!
        #!/jpsama/bin/perl -w
        $tks = `mount`;
        $jpsama = $! if $!;
        print $jpsama;
        

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-23 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found