-Original Message-
From: Thomas 'Gakk' Summers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 8:34 AM
To: [EMAIL PROTECTED]
Subject: File testing
Warning: Perl Novice Alert!
I'm trying to:
1. read in a list of files,
2. test for text,
3. convert the text
-Original Message-
From: Thomas 'Gakk' Summers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 8:34 AM
To: [EMAIL PROTECTED]
Subject: File testing
Warning: Perl Novice Alert!
I'm trying to:
1. read in a list of files,
2. test for text,
3. convert the text files from
Thanks for your quick response.
while (iFH) {
chomp;
s/\n/\r\n/g; # Need to see if this works. I think, it should work.
print oFH;
}
close oFH;
close iFH;
$files[$i] = $tmpfile$i;
Don't know why you are doing this ??
I was going to read thru
Bob Showalter wrote:
A more idiomatic way to write this is:
for my $i (0 .. @files) {
you probably mean:
for my $i (0 .. $#files){
}
the range operator is inclusive.
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thomas 'Gakk' Summers wrote:
Warning: Perl Novice Alert!
I'm trying to:
1. read in a list of files,
2. test for text,
3. convert the text files from '\n' unix to '\r\n' dos
4. write them to a temporary location.
The code below produces an error: 'Use of uninitialized value in -f
Thanks for your help.
I rewrote it using a mix of your suggestions and it works fine now.
FYI: The 'chomp' statement was eliminating the '/n' so the pattern match
was not occuring. That's fixed now too.
Tom.
Thomas 'Gakk' Summers [EMAIL PROTECTED] wrote in message
[EMAIL