Something like this?
#! perl -slw use strict; 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"; for my $folder ( @logfolders, @cgifolders, '' ) { for my $file (@logfiles) { (my $combURL = "$baseurl/$folder/$file") =~ tr[/][]s; print $combURL; } } __END__ C:\test>227227 http:/www.testurl.com/accesslogdir/access.html http:/www.testurl.com/accesslogdir/access_log http:/www.testurl.com/accesslogdir/log.txt http:/www.testurl.com/accesslogdir/log.html http:/www.testurl.com/logs/access.html http:/www.testurl.com/logs/access_log http:/www.testurl.com/logs/log.txt http:/www.testurl.com/logs/log.html http:/www.testurl.com/cgi/access.html http:/www.testurl.com/cgi/access_log http:/www.testurl.com/cgi/log.txt http:/www.testurl.com/cgi/log.html http:/www.testurl.com/cgi-bin/access.html http:/www.testurl.com/cgi-bin/access_log http:/www.testurl.com/cgi-bin/log.txt http:/www.testurl.com/cgi-bin/log.html http:/www.testurl.com/scripts/access.html http:/www.testurl.com/scripts/access_log http:/www.testurl.com/scripts/log.txt http:/www.testurl.com/scripts/log.html http:/www.testurl.com/access.html http:/www.testurl.com/access_log http:/www.testurl.com/log.txt http:/www.testurl.com/log.html C:\test>
Examine what is said, not who speaks.
The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.
In reply to Re: How to list all possible variations ?
by BrowserUk
in thread How to list all possible variations ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |