Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

not found

by BeliBmSoft (Initiate)
on Nov 13, 2024 at 08:08 UTC ( [id://11162670]=perlquestion: print w/replies, xml ) Need Help??

BeliBmSoft has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: not found
by choroba (Cardinal) on Nov 13, 2024 at 08:59 UTC
    How exactly do you call the program from the command line and from what folder?

    How exactly do you call the program via system, what's the current working directory at that moment?

    What do you mean "Perl script is activated via google chrome"? Are you running a local webserver?

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re: not found
by LanX (Saint) on Nov 13, 2024 at 09:05 UTC
    not found very often just means the initial path is not set.

    Either correct your PATH setting for your CGI or use a full path.

    On a side note: Using system inside a web application is a top vulnerability risk if the input isn't checked. I hope you know what you're doing.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

Re: not found
by stevieb (Canon) on Nov 13, 2024 at 08:56 UTC

    Are you serious?

    What are you after here? You have shown no effort at all to follow even reasonable etiquette for any technical review site, let alone this one.

    Code, in <code></code> tags. Version of Perl. Expected output.

    Sheesh. Re-read your post. Ask yourself this... if you sent verbatim what you posted here to anyone else on the planet, what type of response do you think you'd get?

    Go send this exact request to Google. I'm sure they'll help.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: not found
by harangzsolt33 (Deacon) on Nov 13, 2024 at 13:27 UTC
    If you can execute the program from command line in Windows 10, then I am pretty sure that you are either in the directory where this program is located or the program is in the path. So, just type the word "PATH" and press enter. See what it says. The program should be in one of those paths listed. They are separated by a semicolon. Or if it's not, then type "CD" and press Enter. It will give you the current directory and just see if it's there. Type "DIR *.EXE /P" to see what program files you have in the current directory. So, once you locate the program, then you have to execute it using full path. For example, system("C:\\MyProgram\\myprog.exe"); Don't forget to put double \\ because \ is an escape character, it must be doubled for it to produce a single \

    For example, the following perl program line will launch Microsoft Word on my PC:

    system("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE");


    When I try the same in JSScript, an interesting thing happens... Hmmm..


    // This doesn't work for some reason:
    // new ActiveXObject("WScript.Shell").Run("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE");

    // This one works.
    new ActiveXObject("WScript.Shell").Run("C:\\PROGRA~1\\MICROS~2\\OFFICE11\\WINWORD.EXE");

    Well, this is quite lame. It appears that if your folder or program name has spaces in it or is longer than 8+3 characters that is standard in DOS, then the program must be referred to by its 8+3 name. This is beyond stupid, but this could be the reason why you can't launch the program from JS.

      Don't forget to put double \\ because \ is an escape character, it must be doubled for it to produce a single \
      Ignoring all the rest of that but you could avoid interpolation by using single quotes.
        Escapes are not a matter of interpolation.

        Even inside single quotes you'll need to double backslashes, otherwise it wouldn't be possible to escape a single quote.

        Consider 'O\'Reilly'

        Probably you are confusing it with the worse "slasheritis" in other languages.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11162670]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-11-14 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (39 votes). Check out past polls.