Ok.  That gets me quite a bit further down the road.  What I've done now is
the following that will run when the OS is NT:

# change forward slashes to backslashes for each line in file called filetab
open (FILETAB, "+<${filetab}") or die ("Cannot open $filetab for update
\n");
while (<FILETAB>) {
  print $_;
  s#/#\\#g;
  print $_;
  #print FILETAB $_;
}

this generates:

d:/test/directory/S0000001.LOG
d:\test\directory\S0000001.LOG
d:/test/directory/S0000002.LOG
d:\test\directory\S0000002.LOG
....

I think this open syntax opens for both read and write, but I haven't been
able to figure out how to write the changed line back to the file, then move
on to the next line.  The above snippet does not update the contents of the
file.
print $_ shows me the changed output.
print FILETAB $_ generates some weird output but still doesn't change the
contents of the file.

Thanks again.
> ----------
> From:         [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]]
> Sent:         Wednesday, August 29, 2001 11:13 AM
> To:   Rice, Elizabeth A.
> Subject:      Re: File names on NT
> 
> The following message is a courtesy copy of an article
> that has been posted to perl.beginners as well.
> 
> >>>>> "Elizabeth" == Elizabeth A Rice <[EMAIL PROTECTED]> writes:
> 
> Elizabeth> The File::Find puts the names into the $filetab with forward
> slashes.  On
> Elizabeth> NT, the archive program isn't prepared to handle filenames with
> forward
> Elizabeth> slashes instead of backslashes, so says it cannot find the
> files.
> 
> (my $nt_filetab = $filetab) =~ tr#/#\\#;
> 
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
> 0095
> <[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to