Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

RE: RE: RE: Something is wrong and I don'tkow what

by eduardo (Curate)
on Oct 18, 2000 at 07:00 UTC ( [id://37272]=note: print w/replies, xml ) Need Help??


in reply to RE: RE: Something is wrong and I don'tkow what
in thread Something is wrong and I don'tkow what

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.

  • Comment on RE: RE: RE: Something is wrong and I don'tkow what

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-23 00:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found