in reply to Re^3: Tk - system()
in thread Tk - system()

Possibly the problem is you have double quotes ( which will interpolate on it's contents) around my $output = "C:/Users/Desktop";

Try

chdir 'C:/Users/Desktop' ; print pwd, "\n"; # see if it worked #or my $output = 'C:/Users/Desktop';
notice the single quotes.

If it still gives you trouble, specify everything as full paths in single quotes, until you get it to work without the chdir. You can always do a "print pwd\n" to see where you really are.

my @args = ('start', 'C:/Users/Desktop/file.exe' , C:/Users/Desktop/something' );
Once you get it to work with absolutes, work your way backwards and substitute the variables, and check pwd after any chdir attempt.

I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^5: Tk - system()
by lil_v (Sexton) on Aug 06, 2008 at 20:32 UTC
    thanks for your help, the output folder is a user input so I had to chomp that value before using it with chdir. It's fixed now, thanks again!
      I have to tell you lil_v, that you have a bad habit of posting incomplete code examples, then finding a solution for something not shown in your code. In this case, your code shows nothing about "user input", yet it was chomping user input that was the culprit. Even the node title is misleading.

      I had to stare long and hard at your incomplete code example to even make an educated guess at what was wrong. From now on, if you do not post a complete working snippet that demonstrates your problem, I will likely skip over your node. Sorry.... but if you want to be lazy....so do I.


      I'm not really a human, but I play one on earth Remember How Lucky You Are