Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > perl program no longer working in Win2k....suspect some form of system corruption...

Reply
Thread Tools

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

 
 
GO
Guest
Posts: n/a
 
      10-20-2003
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





 
Reply With Quote
 
 
 
 
Jim Gibson
Guest
Posts: n/a
 
      10-20-2003
In article
<LGGkb.203054$ko%(E-Mail Removed) .rogers.com>, GO
<(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
Andrew Shitov
Guest
Posts: n/a
 
      10-21-2003
> @files = `dir /b /on *.*`;

Try this perl idiom:

@files = <*.*>;

 
Reply With Quote
 
GO
Guest
Posts: n/a
 
      10-22-2003

"Jim Gibson" <(E-Mail Removed)> wrote in message
news:201020031451050076%(E-Mail Removed). ..
> In article
> <LGGkb.203054$ko%(E-Mail Removed) .rogers.com>, GO
> <(E-Mail Removed)> 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


 
Reply With Quote
 
GO
Guest
Posts: n/a
 
      10-22-2003

"Andrew Shitov" <(E-Mail Removed)> wrote in message
news:bn2l1k$2abo$(E-Mail Removed)...
> > @files = `dir /b /on *.*`;

>
> Try this perl idiom:
>
> @files = <*.*>;
>


This works as well. Thanks.
Still baffled though


Greg



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
previously working wireless connection no longer working zapspan Wireless Networking 5 01-17-2010 10:11 PM
Re: Yahoo spell check no longer working with Firefox Marcia R.spamlessinlasvegas@cox.net Firefox 1 11-07-2005 03:13 AM
Programs taking longer and longer to start up. Help please. Goforit Computer Information 9 07-25-2004 06:34 AM
FindControl Method no longer working... Karen ASP .Net 2 05-11-2004 06:30 PM
Perl 'system' Creates Program That Dies When First C Program Dies Christopher M. Lusardi Perl Misc 3 10-19-2003 11:53 AM



Advertisments