here here... i am afraid, monk2b that i have to back up what the Anonymous monk said. The insane amount of backslashes that you used, coupled with the multiple print statements are going to make your program slower *AND* unmaintainable.

I don't know the slower, i am not 100% sure, and i have to get a functional spec done or i'd use Benchmark; it makes sense to me, that every time you call a print statement it has to make a function call of some sort (or builtin, or inline replacement, i don't know how the perl interpreter does it...) and that has a great deal of overhead. In your case, constructing the string in memory with HERE text, or using the qq operator (as suggested) by runring causes you to break up lines in places that algorithmically do not make sense (why print out each line individually, when you are trying to print out a document?)

more worrisome to me however, is the maintainability of said code. Having worked for *way* too long on CGI/Web style code, I can guarantee you that maintainability is oft overlooked (even by code that i *know* will only be seen by me) and it's inexistance always regretted. By using so many \"'s and other assorted baddies, you are asking for an interpolation nightmare, if you can avoid having to enter *that* many \ characters in by hand, why on earth aren't you doing it, thereby making your code easier on the eyes, and easier on your wrists! Do yourself a favor, from now on, use the right operator for the right job, if it makes sense for some reason to print line by line by line, then do so, if however you are just trying to print a block of HTML and interpolate variables in there, Perl, the swiss army chainsaw of happyness that it is, has some really nice mechanisms for you to do it.

UPDATE: yeah :) i had a few spelling errors... thanks to those who pointed them out (you know who you are turnstep :)... 12:46 a.m., still working on requirements spec... god help me.


In reply to RE: RE: RE: Something is wrong and I don'tkow what by eduardo
in thread Something is wrong and I don'tkow what by monk2b

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.