|
---|
Replies are listed 'Best First'. | |
---|---|
Re: MyInclude
by simon.proctor (Vicar) on Jun 12, 2003 at 08:18 UTC | |
I also wondered why you went to the trouble of using read only to create an array with the following line: Sorry but that doesn't look right (to my early morning eyes anyway :P ) surely it would have been better to: In this instance? On a different note, you include the the flock call via Fcntl but then you have the flock call commented out. I think you need to clean that up a little bit. SP | [reply] [d/l] [select] |
by stonecolddevin (Parson) on Jun 13, 2003 at 02:17 UTC | |
Well, that's my "defense". I'm sure it doesn't hold a candle to CGI::SSI's version, but it was quick, and that's what I wanted. Thanks for the pointers, I'll fix it next version. Hi, my name is Dhoss, I like to play Quake 3 arena, I drink Vanilla Coke, and I like long walks on the beach while the sun goes down. | [reply] [d/l] [select] |
by Anonymous Monk on Jun 19, 2003 at 04:42 UTC | |
Then add some comments with some special character, to later replace with a dessired chunk of values processed by Perl. Then, at the script, I load the html file in a scalar and s/usbstitute the established comments with the fresh chunk of data processed with the script. I don't need any module to do all these! (Note: I am first trying to manage without the use of modules so as to learn the basics and common scripting habbits. Later, when needing to speed up code creation, I am going to study some basic code implementation:) | [reply] |
by artist (Parson) on Jun 19, 2003 at 05:18 UTC | |
(jeffa) Re: MyInclude
by jeffa (Bishop) on Jun 13, 2003 at 13:15 UTC | |
Here is slightly different version that returns a scalar instead of an array. When you call this sub: $include will either contain the contents of the file or an error message. Instead of differentiating between the two, i recommend just printing $include to the browers, much like PHP does when you give it's include() function a file that doesn't exist or can't be read. (of course, my real recommendation is to just go ahead and install CGI::SSI instead) jeffa L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat) | [reply] [d/l] [select] |