|
|
|
|
|
|
|
![]() |
#1 |
Where there's a will, I want to be in it.
|
perl help
Ok, I'm trying to learn a little perl programming. I have an include file that I use in a bunch of different folders, and I want to be able to replace it without uploading it to each folder individually.
I can locate all the files from the command line. Can a perl program do this? I want to: 1. locate all the files. 2. replace the old files with the new one. I'm just hoping one of you scripting gurus can shorten the learning curve for me. ![]() Thanks SS
__________________
Submit your free sites to Free Sex Pics |
![]() |
![]() |
![]() |
#2 |
I've been mad for fucking years, absolutely years, been over the edge for yonks....
Join Date: Apr 2003
Location: padded room
Posts: 861
|
Hmmm.... You mean you have the same include file in a bunch of folders? If so then you may want to consider having 1 include file for all of the folders. Then when you need to make changes you only need to change the one.
Or am I totally confused about what you are asking?|rasta| |
![]() |
![]() |
![]() |
#3 |
Where there's a will, I want to be in it.
|
Here's the way it's set up. I have the root folder, domain.com, that has an include file in it that's inserted on most of the html docs in the root. I also have a bunch of sub-folders, that need to have the same include file on the html docs in them. The way it's set up now, I have to upload the include file to all of the subfolders whenever I make a change to it.
I can (and probably will) upload the file to an aliased folder and change all the includes to virtual includes. I have a larger project I want to do, and this is the first step in learning to write programs. More confused now? ![]()
__________________
Submit your free sites to Free Sex Pics |
![]() |
![]() |
![]() |
#4 | |
I've been mad for fucking years, absolutely years, been over the edge for yonks....
Join Date: Apr 2003
Location: padded room
Posts: 861
|
Quote:
![]() But I think I got you. It sounds beyond me thought I am afraid. ![]() |
|
![]() |
![]() |
![]() |
#5 |
Where there's a will, I want to be in it.
|
I guess the simplest way to say it is how do you search a directory for a specific file, then upload a new version wherever it's found.
__________________
Submit your free sites to Free Sex Pics |
![]() |
![]() |
![]() |
#6 |
All the way from Room 101
|
If the file you are looking to alter is the same for each location, like a banner and supporting code, you can use a simple include file which all the pages can be pointed at.
<!--#include virtual="/data/banner.html" --> Then to update every page which is linked into the include, you just edit one file. I'm not sure if that's what you were asking, so forgive me if you already know this. ![]()
__________________
![]() |
![]() |
![]() |
![]() |
#7 |
Where there's a will, I want to be in it.
|
That works fine Urb. I'll do it that way. I suppose that's what you were talking about too Madman. Learned something new about virtual includes. Thanks guys.
![]() I would still like to know the best way to accomplisg my original goal. I don't need the exact code. Just a general outline would be great.
__________________
Submit your free sites to Free Sex Pics |
![]() |
![]() |
![]() |
#8 |
Heh Heh Heh! Lisa! Vampires are make believe, just like elves and gremlins and eskimos!
Join Date: Jan 2004
Posts: 72
|
i think i kinda understand what you're looking for....
if you are using PHP, the easiest way would be set the include_path directive in your php.ini file. if you are using Perl, set the path where your include file is located into the Perl include array; for example, if your include file is called "include.pl" which is located in "/some/location/", in each Perl script, do this: push @INC,'/some/location/'; use "include.pl"; Urb's suggestion about using the SSI include will work too hope that helps a bit... unless i am completely wrong about what you're looking for ![]() |
![]() |
![]() |
![]() |
#9 |
Where there's a will, I want to be in it.
|
It all helps vmp. Using the ssi is probably the correct way to do the job, and that's the way I ended up doing it. I wanted to do the search and replace method just to learn some perl. I learned enough doing that to modify another program that does some very useful things. I'm learning new stuff every day. It's really kind of fun.
Thanks again to all who helped.
__________________
Submit your free sites to Free Sex Pics |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|