469,275 Members | 1,628 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

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

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

Jul 19 '05 #1
4 1983
In article
<LG*********************@news04.bloor.is.net.cable .rogers.com>, GO
<aa***@remove.this.chebucto.ns.ca> wrote:
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.
Jul 19 '05 #2
> @files = `dir /b /on *.*`;

Try this perl idiom:

@files = <*.*>;

Jul 19 '05 #3
GO

"Jim Gibson" <jg*****@mail.arc.nasa.gov> wrote in message
news:201020031451050076%jg*****@mail.arc.nasa.gov. ..
In article
<LG*********************@news04.bloor.is.net.cable .rogers.com>, GO
<aa***@remove.this.chebucto.ns.ca> wrote:
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.


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
Jul 19 '05 #4
GO

"Andrew Shitov" <an**@shitov.ru> wrote in message
news:bn***********@gavrilo.mtu.ru...
@files = `dir /b /on *.*`;


Try this perl idiom:

@files = <*.*>;


This works as well. Thanks.
Still baffled though ;)
Greg

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Roy Smith | last post: by
9 posts views Thread by Martin Foster | last post: by
reply views Thread by Kirt Loki Dankmyer | last post: by
223 posts views Thread by Pilcrow | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.