On Monday, Nov 10, 2003, at 09:30 US/Pacific, John W. Krahn wrote:
Ganesh Shankar wrote:[..]
[..]4) I'm developing on a Windows machine, so I think setting file permissions are unnecessary, right?
This problem is described is explained in the documentation for the readdir function.
perldoc -f readdir [snip] If you're planning to filetest the return values out of a `readdir', you'd better prepend the directory in question. Otherwise, because we didn't `chdir' there, it would have been testing the wrong file.
foreach my $seqfilename (@files){ [EMAIL PROTECTED] = @_; $seqfilename = ''; open (TXTFILE,"<$seqfilename") or die $!;
open (TXTFILE,"<$folder/$seqfilename") or die $!;
john,
I agree with your basic solution, but since he will
be doing his development in Windows, shouldn't that
be 'file system neutral'? hence not using the unix
separator "/" between the directory component and the filename component?
Hence that the OP should do the
chdir($folder);
since he has already established that the directory existed when collecting up the list of files for 'input', and this should be done prior to doing the
foreach my $seqfilename (@files){ open (TXTFILE,"<$seqfilename") or die $!; ... }
so that the code will 'work' on more OS's.
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]