RE: Directories into arrays, again.

2005-08-29 Thread Daniel Kurtz
From: JupiterHost.Net [mailto:[EMAIL PROTECTED] > Or weren't. >>> So its working now then? What changed? <<< Changes to the file system wrought in the shell are not visible to the calling Perl program until the shell's file handle is closed or otherwise reset. Simply had to close() the file h

Re: Directories into arrays, again.

2005-08-26 Thread JupiterHost.Net
Then that would be the code to show :) although I bet strict/warnings/and checking your open's (or die $!;) will show you what is wrong :) <<< I see, however that is still the best practice to be in, especially when asking for assistance since it catches 99.9% of little issues. No, the .

RE: Directories into arrays, again.

2005-08-26 Thread Daniel Kurtz
From: JupiterHost.Net [mailto:[EMAIL PROTECTED] > # Execute a command that backs up every file in the directory # with a > .bak extension. >>> Um, ok so you're wondering why there are no .bak files? Then that would be the code to show :) although I bet strict/warnings/and checking your open's

RE: Directories into arrays, again.

2005-08-26 Thread Daniel Kurtz
Excellent points, all From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] >>> And a reason why using a shell command to copy a file is a bad idea. <<< Well, the 'shell' and 'copy' association in this case is actually something of a red herring. The point of this particular script is not to copy fi

Re: Directories into arrays, again.

2005-08-26 Thread JupiterHost.Net
Daniel Kurtz wrote: Sorry, obviously the code is supposed to read: Actually it should read: use strict; use warnings; opendir( DIR1, "."); opendir DIR1, '.' or die "Could not open .: $!"; @before = readdir(DIR1); my @before = readdir DIR1; closedir(DIR1); # Execute a command that

Re: Directories into arrays, again.

2005-08-26 Thread Wiggins d'Anconia
Daniel Kurtz wrote: > From: Daniel Kurtz [mailto:[EMAIL PROTECTED] > Why does @after end up looking exactly like @before? Is there some > > buffering going on here? And if so, how do I clear it? <<< > > Never mind, I figured it out. The file copying operation is another > shell operation (c

RE: Directories into arrays, again.

2005-08-26 Thread Daniel Kurtz
From: Daniel Kurtz [mailto:[EMAIL PROTECTED] >>> Why does @after end up looking exactly like @before? Is there some buffering going on here? And if so, how do I clear it? <<< Never mind, I figured it out. The file copying operation is another shell operation (c'mon, I'm a newby, and I've only rea

RE: Directories into arrays, again.

2005-08-26 Thread Daniel Kurtz
Sorry, obviously the code is supposed to read: opendir( DIR1, "."); @before = readdir(DIR1); closedir(DIR1); # Execute a command that backs up every file in the directory # with a .bak extension. opendir( DIR2, "."); @after = readdir(DIR2); closedir(DIR2); It still doesn't work. daniel -- To