Connecting Tech Pros Worldwide Forums | Help | Site Map

need to open command prompt

Newbie
 
Join Date: Apr 2009
Posts: 13
#1: Apr 22 '09
I am new to perl script.
How can I open a command prompt/shell and execute my command over there in perl.

I have tried to use System() but its not helping to resolve my issue.

Thanks in Advance
Lav

Expert
 
Join Date: Apr 2006
Posts: 512
#2: Apr 22 '09

re: need to open command prompt


what command are you issuing? The fact is, most probably Perl can handle it on its own without resorting to system calls. (unless you are calling a proprietary application). show your code and example input files if any.
Newbie
 
Join Date: Apr 2009
Posts: 10
#3: Apr 22 '09

re: need to open command prompt


open your terminal. use cd to navigate to the file in which your perl file is stored

cd programs/

then use perl to run it

perl program.pl
Newbie
 
Join Date: Apr 2009
Posts: 13
#4: Apr 23 '09

re: need to open command prompt


the command that I am trying to run is actually not a system command. This is my work specific command that contains lots of parameters.
The issue is that some parameter values are filepaths and the path could be long and could contain spaces.

While using system() I have to use "\" every place where space or any spl character arrived in the path. So I want to know that If i can open a seprate terminal and type my command over there by only using double quotes for path through perl.
Newbie
 
Join Date: Apr 2009
Posts: 10
#5: Apr 23 '09

re: need to open command prompt


I don't see why you couldn't do that. also use underscore "_"for spaces
Icecrack's Avatar
Expert
 
Join Date: Sep 2008
Location: Sydney, Australia
Posts: 173
#6: Apr 27 '09

re: need to open command prompt


Post what command your trying to call from the system();
Reply