Re: Again : Including other files
Hi Rajeev, it is the approach of perl4: without modules, You can use this but it will be better for you if created a module (or modules) from the included file and use that module. the performance difference is neglectable compared to the runtime of a script. see perldoc perlmod -- Gabor Rajeev Rumale wrote: Hi, I have a similar situation in my project. I have created a file like mylib.pl and I put all my subroutines into it. In every page which I use i just add a line require mylib.pl IT works fine for me. I would like to know 1. if this approch is Good 2. Is their any performance problem compared to writing the subs directly in main. 3. Is there any better approch. with regards Rajeev Rumale -- Gabor Szabo http://www.tracert.com/ Web backend development Phone: +972-(0)54-624648
Including other files
Can you include say a header and footer .cgi file that is just a subroutine? The reason I ask, is that it seems to me that it might make things (on a larger application) easier if all you had to do was mess with the middle content of the pages. Does this make sense at all? -James
Re: Including other files
On Wed, 27 Jun 2001, James Kelty wrote: Can you include say a header and footer .cgi file that is just a subroutine? The reason I ask, is that it seems to me that it might make things (on a larger application) easier if all you had to do was mess with the middle content of the pages. Does this make sense at all? Include where? Include head and footer subs in a main CGI script? You can certainly do that, if you properly create a a module and import the subroutines. If you are talking about using SSI in HTML, you can do that also, if your server supports SSI. You might want to take a look at Mason: http://masonhq.com. It's a Perl-based component framework for building web applications, and can accomplish what you want to do, and much more on top of that. -- Brett http://www.chapelperilous.net/btfwk/ Breeding rabbits is a hare raising experience.
Re: Including other files
Sorry about the confusion. I did mean in the body of the main cgi and subsequent cgis later. Not SSIs. Sorry about that. -James Brett W. McCoy wrote: On Wed, 27 Jun 2001, James Kelty wrote: Can you include say a header and footer .cgi file that is just a subroutine? The reason I ask, is that it seems to me that it might make things (on a larger application) easier if all you had to do was mess with the middle content of the pages. Does this make sense at all? Include where? Include head and footer subs in a main CGI script? You can certainly do that, if you properly create a a module and import the subroutines. If you are talking about using SSI in HTML, you can do that also, if your server supports SSI. You might want to take a look at Mason: http://masonhq.com. It's a Perl-based component framework for building web applications, and can accomplish what you want to do, and much more on top of that. -- Brett http://www.chapelperilous.net/btfwk/ Breeding rabbits is a hare raising experience.
Re: Including other files
On Wed, 27 Jun 2001, James Kelty wrote: Sorry about the confusion. I did mean in the body of the main cgi and subsequent cgis later. Not SSIs. Sorry about that. Well, yes, you can do that. In fact, from a design standpoint, it's definitely a good idea to take out the common elements of your webpages and include them in the parts that change. Again, take a look at Mason. -- Brett http://www.chapelperilous.net/btfwk/ Huh?
Re: Including other files
Hi, I have a similar situation in my project. I have created a file like mylib.pl and I put all my subroutines into it. In every page which I use i just add a line require mylib.pl IT works fine for me. I would like to know 1. if this approch is Good 2. Is their any performance problem compared to writing the subs directly in main. 3. Is there any better approch. with regards Rajeev Rumale ~~~ Rajeev Rumale MyAngel.Net Pte Ltd.,Phone : (65)8831530 (office) #04-01, 180 B, The Bencoolen, Email : [EMAIL PROTECTED] Bencoolen Street, Singapore - 189648 ICQ: 121001541 Website : www.myangel.net ~~~ - Original Message - From: Mark Bergeron [EMAIL PROTECTED] To: James Kelty [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 28, 2001 8:01 AM Subject: Re: Including other files Yes you can. -Original Message- From: James Kelty[EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Wed Jun 27 15:18:23 PDT 2001 Subject: Including other files Can you include say a header and footer .cgi file that is just a subroutine? The reason I ask, is that it seems to me that it might make things (on a larger application) easier if all you had to do was mess with the middle content of the pages. Does this make sense at all? -James /~_. _ | _ _ _ _ \_/|(_||| | |(_)| | _| ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com