Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I actually want to be able to do all variations of the above including all folders and all files in all the four arrays. but i also want to hit urls that are just off the main bsae url i.e. instead of running through as above I also want to be able to access urls such as http://www.testurl.com/test.pl instead of http://www.testurl.com/cgi-bin/test.pl this gets messed up as my way of doing it will always add the $folder variable into the compiled url via the join statement !!!. I know there will be an easy way of doing this but my brain has switched off !!!! Hard to explain, hopefully someone will get my gist :)@logfiles=("access.html","access_log","log.txt","log.html"); @logfolders=("accesslogdir","logs"); @cgifolders=("cgi","cgi-bin","scripts"); @cgifiles=("script.pl","test.pl","tools.pl"); $baseurl="http://www.testurl.com"; foreach $folder(@logfolders) { foreach $file(@logfiles) { my($url)=join '',$baseurl,$folder,"/",$file; print "Compiled URL - $url\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to list all possible variations ?
by BrowserUk (Patriarch) on Jan 15, 2003 at 21:33 UTC | |
by Anonymous Monk on Jan 15, 2003 at 22:24 UTC | |
by BrowserUk (Patriarch) on Jan 15, 2003 at 22:33 UTC | |
|
Re: How to list all possible variations ?
by Enlil (Parson) on Jan 15, 2003 at 21:37 UTC | |
|
Re: How to list all possible variations ?
by dragonchild (Archbishop) on Jan 15, 2003 at 21:21 UTC | |
by Anonymous Monk on Jan 15, 2003 at 21:32 UTC | |
by dragonchild (Archbishop) on Jan 15, 2003 at 21:52 UTC |