in reply to MyInclude

You don't mention why you wanted to re-invent the wheel here. What purpose was there for this? Plus it doesn't look like it would even pass as a drop in replacement for the include method within the CGI::SSI module.

I also wondered why you went to the trouble of using read only to create an array with the following line:
my @data_arr = $data;
Sorry but that doesn't look right (to my early morning eyes anyway :P ) surely it would have been better to:
my @data_arr = <DATA>;
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

Replies are listed 'Best First'.
Re: Re: MyInclude
by stonecolddevin (Parson) on Jun 13, 2003 at 02:17 UTC
    Good points, simon.proctor. I guess I used my @data_arr = $data; because I had used it in writing a guestbook and it had worked pretty well. I commented out the flock call because it isn't supported on my winblows box, and I suppose I forgot to un-comment it. As far as my desire to re-invent the wheel, I wanted to provide a quick access function snippet for people not using CGI::SSI, for people like me who haven't had a chance to install it.
    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.
      I use this kind of code in a sort of an html-template way: I first edit my html file with wysiwyg FrontPage.

      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:)

        (Note: I am first trying to manage without the use of modules so as to learn the basics and common scripting habbits. )
        What's wrong with making habits of using the modules first if available? May be the energy is spend correctly.

        artist