Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Perl/Tk System Function Error

by keszler (Priest)
on Nov 18, 2011 at 01:07 UTC ( #938719=note: print w/ replies, xml ) Need Help??


in reply to Perl/Tk System Function Error

On my XP system, removing the double-quotes makes it run calc. With the double-quotes I get a command window. Not sure why, but

system(qq{start C:\\Windows\\system32\\calc.exe});
is the way to go. The same behavior occurs at the command prompt: with quotes, cmd window; without, calc.


Comment on Re: Perl/Tk System Function Error
Download Code
Re^2: Perl/Tk System Function Error
by perl.j (Pilgrim) on Nov 18, 2011 at 01:10 UTC
    It works! Thanks!
    --perl.j
Re^2: Perl/Tk System Function Error
by Anonymous Monk on Nov 18, 2011 at 09:07 UTC

    Because you, like many, have not read "help start" or "help cmd"

    I use Proc::Background

Re^2: Perl/Tk System Function Error
by afoken (Parson) on Nov 18, 2011 at 10:20 UTC
    removing the double-quotes makes it run [...] Not sure why

    Simple: The first argument of the start command, when put in double quotes, is taken as the requested window title. If you need to quote the command to be started, you also need to provide a dummy window title, i.e.:

    system('start "" "C:\\program files\\my application\\kaboom.exe" /foo +/bar');

    Also note that system() has a special case on Windows to run a program (with arguments) without waiting for it, and without having to mess with any shell or the braindead start program. This is documented in perlport:

    system(1,'C:\\program files\\my application\\kaboom.exe','/foo','/bar' +); # ^-- the 1 is the special case for Windows

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938719]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-08-02 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls