in reply to How to list all possible variations ?
2. You need to close your first foreach statement.
But what I think you want can be accomplished like so:
I am assuming that you would be creating a second set of loops for the cgi stuff.use strict; use warnings; my @logfiles=("access.html","access_log","log.txt","log.html"); my @logfolders=("accesslogdir","logs"); my @cgifolders=("cgi","cgi-bin","scripts"); my @cgifiles=("script.pl","test.pl","tools.pl"); my $baseurl="http://www.testurl.com/"; foreach my $folder (@logfolders) { my @url; foreach my $file(@logfiles) { $url[0]=join '',$baseurl,$folder,"/",$file; $url[1]=join '',$baseurl ,$file; print "Compiled URLs - $url[0], $url[1]\n"; } }
-enlil
|
|---|