473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 2113
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Roy Smith | last post by:
I'm working on a prototype of a new application in Python. At some point, if this ever turns into a product, the powers that be will almost certainly demand that it be done in Perl. My job will...
9
by: Martin Foster | last post by:
Hi. I would like to be able to mimic the unix tool 'uniq' within a Perl script. I have a file with entries that look like this 4 10 21 37 58 83 111 145 184 226...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
7
numberwhun
by: numberwhun | last post by:
**NOTE: This article is written using the 5.8.8 Alpha2 release of Strawberry Perl. I am writing this article with much joy and glee. This is due to the fact that Active State no longer has a...
4
by: ARC | last post by:
Hello all, I'm trying to help a customer of mine recover data from an access 2000 program that appears to have corruption. Opening the file will open the default / startup form, however, you...
6
by: spider661 | last post by:
im trying to make a perl file that will take all the info from a spell_us.txt file and place it into an sql file i can import into my database but its not working can anyone help please? ...
223
by: Pilcrow | last post by:
Given that UNIX, including networking, is almost entirely coded in C, how come so many things are almost impossible in ordinary C? Examples: Network and internet access, access to UNIX...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.