in reply to Re: qx vs WScript: Why didn't qx work in my ActiveState's PerlScript?
in thread qx vs WScript: Why didn't qx work in my ActiveState's PerlScript?

I suspect that jkahn is correct. In light of that, you might consider a "pure Perl" solution. Instead of using "ls" (or "dir"), use a combination of opendir(), readdir(), stat(), and closedir() to effect the directory listing. You might also need a chdir() to ensure you're in the right starting place; web servers are notoriously inconsistent about what working directory they use for scripts.

Replies are listed 'Best First'.
Re: Re: Re: qx vs WScript: Why didn't qx work in my ActiveState's PerlScript?
by chunlou (Curate) on Sep 11, 2002 at 22:57 UTC
    Sorry for the confusion :p... I meant to use "ls" merely as a generic example. (Maybe I should use "foo"?)... Besides, I do have ls.exe on my Windows (Windows-port of Unix tools). Thanks.
      Yes, but if you are running this from a browser, you are not running as yourself, but as httpd or whatever your web server calls itself on your platform. This user has an empty path and to use a program such as ls.exe, you must give it the full path to it. It may also not have the rights to execute the program

      Regards,

      Helgi Briem