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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GO

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

    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





  • Jim Gibson

    #2
    Re: perl program no longer working in Win2k....suspec t some form of system corruption...

    In article
    <LGGkb.203054$k o%.181693@news0 4.bloor.is.net. cable.rogers.co m>, GO
    <aa533@remove.t his.chebucto.ns .ca> wrote:
    [color=blue]
    > 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[/color]

    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.

    Comment

    • Andrew Shitov

      #3
      Re: perl program no longer working in Win2k....suspec t some formof system corruption...

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

      Try this perl idiom:

      @files = <*.*>;

      Comment

      • GO

        #4
        Re: perl program no longer working in Win2k....suspec t some form of system corruption...


        "Jim Gibson" <jgibson@mail.a rc.nasa.gov> wrote in message
        news:2010200314 51050076%jgibso n@mail.arc.nasa .gov...[color=blue]
        > In article
        > <LGGkb.203054$k o%.181693@news0 4.bloor.is.net. cable.rogers.co m>, GO
        > <aa533@remove.t his.chebucto.ns .ca> wrote:
        >[color=green]
        > > 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[/color][/color]
        names[color=blue][color=green]
        > > 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[/color][/color]
        the[color=blue][color=green]
        > > current hard drive and tries to replace files there.
        > >
        > > I've been using a compiled version (compiled by perl2exe) of my[/color][/color]
        application[color=blue][color=green]
        > > and thought it had become corrupted so I restored it from a backup, but[/color][/color]
        it[color=blue][color=green]
        > > 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[/color][/color]
        program[color=blue][color=green]
        > > 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[/color][/color]
        back[color=blue][color=green]
        > > 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[/color][/color]
        system[color=blue][color=green]
        > > 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[/color][/color]
        root of[color=blue][color=green]
        > > the
        > > current drive, regardless of what folder I am presently in. I'm sure[/color][/color]
        there[color=blue][color=green]
        > > 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[/color][/color]
        I[color=blue][color=green]
        > > 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[/color][/color]
        this[color=blue][color=green]
        > > issue.
        > >
        > >
        > > TIA,
        > >
        > > Greg[/color]
        >
        > 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.[/color]

        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


        Comment

        • GO

          #5
          Re: perl program no longer working in Win2k....suspec t some form of system corruption...


          "Andrew Shitov" <andy@shitov.ru > wrote in message
          news:bn2l1k$2ab o$1@gavrilo.mtu .ru...[color=blue][color=green]
          > > @files = `dir /b /on *.*`;[/color]
          >
          > Try this perl idiom:
          >
          > @files = <*.*>;
          >[/color]

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


          Greg



          Comment

          Working...