Rob Dixon made a couple of mistakes in writing:
>>
>> closedir(DIR);
>
> Do this after you've finished reading it.
(meaning 'directly after you've finished reading the directory' :)
> This should work roughly as intended. If you need to know what
> your current working directory is,
>
> use C
Jose Malacara wrote:
>> opendir(DIR, 'data') ...
>
> This allows me to grab the correct file names from within the 'data'
> directory, but I guess that my problem happens when the script
> actually goes to parse those files that it only looks for the
> filenames locally, rather than in the actual '
Jose Malacara wrote:
> foreach my $file (@files) {
>my $input="$file";
>
> open(INFILE,"$input") || die "Can't open file $input"; #<=== is opening
> correct file name, but not 'data/logfile1.
I think your problem is here. Presuming that data is a subdirectory of the directory
your script
ot;;
}
}
}
}
closedir(DIR);
close INFILE;
==
- Original Message -
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
To: "Jose Malacara" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 04, 2003 8:11 PM
Jose Malacara wrote:
> opendir(DIR, ".");
> my @files = readdir(DIR);
How about:
opendir (DIR, "../adm"); ?
It works for me.
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Sure lots of ways, this is Perl ;-)...
Jose Malacara wrote:
Hello.
I have a script that parses csv files for the occurence of an IP address that is passed to the script as an argument when it runs. Currently, I can only run the script from within the same directory as my data files. I would like
Hello.
I have a script that parses csv files for the occurence of an IP address that is
passed to the script as an argument when it runs. Currently, I can only run the script
from within the same directory as my data files. I would like to be able to move my
csv files into a separate data direc