473,725 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

perl program no longer working in Win2k....suspec t 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 2134
In article
<LG************ *********@news0 4.bloor.is.net. cable.rogers.co m>, GO
<aa***@remove.t his.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.a rc.nasa.gov> wrote in message
news:2010200314 51050076%jg**** *@mail.arc.nasa .gov...
In article
<LG************ *********@news0 4.bloor.is.net. cable.rogers.co m>, GO
<aa***@remove.t his.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
2143
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 be to convince them otherwise. The basic design of the application is object oriented. I've never used Perl's OO features, so I'm not in a good position to make a comparison of the two languages from an OO point of view. Can somebody who's...
9
10196
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 4 12 24 42 64 92 124 162 204 252 4 11 23 44 67 95 134 168 215 271 ..
0
9743
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. I need it to be compiled with threads. Anyone have any wisdom on how best to do this? Here's a transcript of my latest attempt. It's long; you might want to skip to the bottom, where I try "make" and the fatal errors start happening.
7
55130
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 monopoly on the issue of Perl on the Windows platform As anyone who code's Perl on the Windows platform knows, the choice that you have (had) for Perl on Windows was Active State. It worked great for your scripting but when it came to installing...
4
2277
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 can't get into the one module that is present. They have the module named: Global Module. Double-clicking this gives the error: "The module name 'Global Module' is misspelled or refers to a module that doesn't exist." I ran a repair, and this did...
6
1500
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? #!/usr/bin/perl -w # # Imports spells from spell_us.txt to spell table, as described in the config below $spellfile="spells_us.txt"; $sqlspellfile="allspells.sql"; $tbspells = "spells";
223
7272
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 interprocess controls and communication, locale determination, EBCDIC/ASCII discrimination, etc. Almost all of these are easy in Perl. Why isn't there a mechanism like perl modules to allow easy extentions for facilities like these? Isn't anyone working...
10
6975
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 of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
0
8874
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8748
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9248
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9092
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6695
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4775
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3212
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2151
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.