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

Discussion in 'Perl' started by GO, Oct 20, 2003.

  1. GO

    GO Guest

    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
     
    GO, Oct 20, 2003
    #1
    1. Advertising

  2. GO

    Jim Gibson Guest

    In article
    <LGGkb.203054$ko%>, GO
    <> 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.
     
    Jim Gibson, Oct 20, 2003
    #2
    1. Advertising

  3. Re: perl program no longer working in Win2k....suspect some formof system corruption...

    > @files = `dir /b /on *.*`;

    Try this perl idiom:

    @files = <*.*>;
     
    Andrew Shitov, Oct 21, 2003
    #3
  4. GO

    GO Guest

    "Jim Gibson" <> wrote in message
    news:201020031451050076%...
    > In article
    > <LGGkb.203054$ko%>, GO
    > <> 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
     
    GO, Oct 22, 2003
    #4
  5. GO

    GO Guest

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

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


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


    Greg
     
    GO, Oct 22, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    1
    Views:
    477
    bruce barker
    Nov 26, 2003
  2. Selen

    sqlserver database suspect

    Selen, Jan 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    698
    =?Utf-8?B?RWR3YXJk?=
    Jan 29, 2004
  3. Smithers

    A Caching Issue - I Suspect

    Smithers, Feb 8, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    437
    Win, Pats
    Feb 11, 2005
  4. comcast

    1.1 com interface (I suspect)

    comcast, Jun 22, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    357
    Ray Booysen
    Jun 22, 2006
  5. Neil
    Replies:
    27
    Views:
    643
Loading...

Share This Page