<?xml version="1.0" encoding="windows-1252"?>
<node id="293241" title="Range of File Names and For/While Problem" created="2003-09-22 15:27:34" updated="2005-06-07 00:10:57">
<type id="115">
perlquestion</type>
<author id="225273">
Dru</author>
<data>
<field name="doctext">
Hello Monks,&lt;br&gt;&lt;br&gt;

I have two questions that I'm seeking guidance with:&lt;br&gt;&lt;br&gt;

1. Is there a way so I do not have to write out each file seprately? For example something like:

&lt;code&gt;
my @files = ('d:\log\exported\10Sep2003.elog' .. 
'd:\log\exported\17Sep2003.elog')
&lt;/code&gt;

I know this will not work, but I think you guys will see what I'm trying to do.&lt;br&gt;&lt;br&gt;

2. In the below code, my 'for' loop is not working the way I intended to. It is combining all of the file names into one file and then trying to proceed with the while loop. Here is the error I get when I run this script:
&lt;code&gt;
Can not open d:\log\exported\10Sep2003.elog d:\log\exported\11Se
p2003.elog d:\log\exported\12Sep2003.elog d:\log\exported\13Sep2
003.elog d:\log\exported\14Sep2003.elog d:\log\exported\15Sep200
3.elog d:\log\exported\16Sep2003.elog d:\log\exported\17Sep2003.
elog d:\log\exported\22Sep2003.elog: No such file or director
&lt;/code&gt;
 I thought that it would iterate over the first file move onto the while loop and then begin again. Anyone know what I'm doing wrong?

&lt;code&gt;
My Script:

use warnings;
use strict;

my $file1 = 'd:\log\exported\10Sep2003.elog';
my $file2 = 'd:\log\exported\11Sep2003.elog';
my $file3 = 'd:\log\exported\12Sep2003.elog';
my $file4 = 'd:\log\exported\13Sep2003.elog';
my $file5 = 'd:\log\exported\14Sep2003.elog';
my $file6 = 'd:\log\exported\15Sep2003.elog';
my $file7 = 'd:\log\exported\16Sep2003.elog';
my $file8 = 'd:\log\exported\17Sep2003.elog';
my $file9 = 'd:\log\exported\22Sep2003.elog';

my @files = qq($file1 $file2 $file3 $file4 $file5 $file6 $file7 
$file8 $file9);

my ($fw, $rule1, $dst);

for (@files){
 open (FILE, $_) or die "Can not open $_: $!\n";
  while (&lt;FILE&gt;){
   ($fw, $dst, $rule1) = (split /;/)[3,11,15];
   print if ($fw =~ /192\.168\.15\.1/) &amp;&amp; 
($dst =! /192\.168\.31\.25/) &amp;&amp; ($rule1 =~ /\b12\b/);
  }
&lt;/code&gt;</field>
</data>
</node>
