By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,809 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,809 IT Pros & Developers. It's quick & easy.

need to open command prompt

P: 13
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
Apr 22 '09 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 511
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.
Apr 22 '09 #2

P: 10
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
Apr 22 '09 #3

P: 13
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.
Apr 23 '09 #4

P: 10
I don't see why you couldn't do that. also use underscore "_"for spaces
Apr 23 '09 #5

Icecrack
Expert 100+
P: 174
Post what command your trying to call from the system();
Apr 27 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.