perl program no longer working in Win2k....suspect some form of system corruption...

G

GO

I have a custom Perl application (programmed by myself) that is used to
rename files. For some reason, within the last month, it is no longer
working properly. Prior to this I've been using it for several years
without problem. It's a relatively simple program that reads the file names
from the current directory and replaces strings of text issued from
command-line
parameters. But now, for some unknown reason, it looks in the root of the
current hard drive and tries to replace files there.

I've been using a compiled version (compiled by perl2exe) of my application
and thought it had become corrupted so I restored it from a backup, but it
made no difference. I reinstalled Perl and ran the source code but
still with the same results. I then booted into Windows XP and the program
ran flawlessly there. I restored my standard Win2k image (onto a second
drive) and tried running it again; it ran fine there as well. At this
point I figured something has been corrupted in my main OS. I booted back
into my main Win2k and uninstalled all of the latest hotfixes but to no
avail.

I am using Active Perl build 518. The problem occurs when I do a system
call to get the directory listing:
@files = `dir /b /on *.*`;
If I am to print the contents of @files it shows the contents of the root of
the
current drive, regardless of what folder I am presently in. I'm sure there
is a
more elegant way getting the directory listing but, as I said, I've been
using
the program for years now with no problems.

I'm sure it is more of a problem with the OS rather than Perl itself but I
thought
I'd post here to see if anyone has any insights. I also realize I can
easily fix this
problem by restoring my Ghost image but I am curious as to the cause of this
issue.


TIA,

Greg
 
J

Jim Gibson

GO said:
I have a custom Perl application (programmed by myself) that is used to
rename files. For some reason, within the last month, it is no longer
working properly. Prior to this I've been using it for several years
without problem. It's a relatively simple program that reads the file names
from the current directory and replaces strings of text issued from
command-line
parameters. But now, for some unknown reason, it looks in the root of the
current hard drive and tries to replace files there.

I've been using a compiled version (compiled by perl2exe) of my application
and thought it had become corrupted so I restored it from a backup, but it
made no difference. I reinstalled Perl and ran the source code but
still with the same results. I then booted into Windows XP and the program
ran flawlessly there. I restored my standard Win2k image (onto a second
drive) and tried running it again; it ran fine there as well. At this
point I figured something has been corrupted in my main OS. I booted back
into my main Win2k and uninstalled all of the latest hotfixes but to no
avail.

I am using Active Perl build 518. The problem occurs when I do a system
call to get the directory listing:
@files = `dir /b /on *.*`;
If I am to print the contents of @files it shows the contents of the root of
the
current drive, regardless of what folder I am presently in. I'm sure there
is a
more elegant way getting the directory listing but, as I said, I've been
using
the program for years now with no problems.

I'm sure it is more of a problem with the OS rather than Perl itself but I
thought
I'd post here to see if anyone has any insights. I also realize I can
easily fix this
problem by restoring my Ghost image but I am curious as to the cause of this
issue.


TIA,

Greg

I don't use windoze, so can't help you with your specific problem, but
you might consider using the readdir function or the File::Find module
to search directories for file names.

perldoc -f readdir
perldoc File::Find

FYI: this newsgroup is defunct; try comp.lang.perl.misc in the future.
 
G

GO

Jim Gibson said:
I don't use windoze, so can't help you with your specific problem, but
you might consider using the readdir function or the File::Find module
to search directories for file names.

perldoc -f readdir
perldoc File::Find

FYI: this newsgroup is defunct; try comp.lang.perl.misc in the future.

The function works perfectly. Not that I doubted that it wouldn't! :)
Thanks.
I still haven't come up with a reason for what happened though :(

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top