473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Connecting to command prompt

Hi all,

I m new to perl, and writing a script , in which i need to connect to the command prompt from my perl script and pass some commands like " mkdir testdir".

Is there any module available in perl to do this (in python we have os module) . I googled for it but i didnt get any help.

If any one has idea, please reply asap.
It's urgent.

thanks in advance

bunny
Feb 14 '08 #1
5 1396
nithinpes
410 Expert 256MB
Hi all,

I m new to perl, and writing a script , in which i need to connect to the command prompt from my perl script and pass some commands like " mkdir testdir".

Is there any module available in perl to do this (in python we have os module) . I googled for it but i didnt get any help.

If any one has idea, please reply asap.
It's urgent.

thanks in advance

bunny
Hi bunny,
You don't need any module for this. Just put the DOS commands within reverse quotes( ` ).


like:
Expand|Select|Wrap|Line Numbers
  1. `mkdir testdir`;
  2.  
will create the directory testdir. Reverse quote is used to execute system commands.
Feb 14 '08 #2
Hi Nithin

Thanks for ur response, it works fine for me. :)

rgds
bunny


Hi bunny,
You don't need any module for this. Just put the DOS commands within reverse quotes( ` ).


like:
Expand|Select|Wrap|Line Numbers
  1. `mkdir testdir`;
  2.  
will create the directory testdir. Reverse quote is used to execute system commands.
Feb 15 '08 #3
KevinADC
4,059 Expert 2GB
hopefully nobody sends the command "del c:\" to your perl script. Direct unfiltered input of system commands is very dangerous.
Feb 15 '08 #4
Hi Bunny,

inaddition to back quotes, you can also use 'system' as follows

system('mkdir testdir');

system will execute os commands from Perl

-Nagendra Pidaparthy

Hi all,

I m new to perl, and writing a script , in which i need to connect to the command prompt from my perl script and pass some commands like " mkdir testdir".

Is there any module available in perl to do this (in python we have os module) . I googled for it but i didnt get any help.

If any one has idea, please reply asap.
It's urgent.

thanks in advance

bunny
Feb 17 '08 #5
numberwhun
3,509 Expert Mod 2GB
H
If any one has idea, please reply asap.
It's urgent.
Also, please know that putting "Its urgent" or "Its an emergency", does not get you help any faster. Everyone here are volunteers and are not bound by the urgencies that you are under. Its best to just ask your question(s) and wait for their answer(s) that are provided.

Regards,

Moderator
Feb 17 '08 #6

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

Similar topics

0
by: Google Mike | last post by:
After a lot of thought and research, and playing with FreeTDS and InlineTDS, as well as various ODBC connections, I have determined that the fastest and cheapest way to get up and going with PHP on...
3
by: Rog | last post by:
Yes, I am guessing that typing cmd in the run windows will bring up the command prompt, but not the vs.net command prompt. Is there a switch(s) for accessing the vs.net command prompt? Or...
4
by: glenn | last post by:
I keep reading all sorts of books on VS that keep telling me to click on Tools/Visual Studio Command prompt to run this program or that program. However, I do not have such a menu choice. Where is...
4
by: Thomas Johnson | last post by:
I am trying to find out how to access the VS 2003 .Net command prompt. I am trying to execute the 'csc' command against a module but have no idea where to find the command prompt. Here's a stupid...
2
by: TOM | last post by:
Hello, I am having problems with the server explorer making a connection to the SQL server. I can see the instances that i want to connect to but when i try this error comes up PROVIDER CANNOT BE...
6
by: Alexander Cohen | last post by:
Im trying to connect locally to a database on a running postgres cluster. If i connect with psql, everything is fine and i can transact. I i try and connect in my own app, i get this error: ...
10
by: Mike Collins | last post by:
I am trying to connect to a 2003 Server from an ASP.Net page and am getting the following error message. Can someone please help get me started on how to track and fix this error? The code I am...
3
by: kimiraikkonen | last post by:
Hi experts, I just want to ask a simple procedure of my simple form. My form has a input textbox and a button. I want this if you can help me: Application user types a command prompt command...
0
by: jags_32 | last post by:
Hello We use MFG-PRO as our ERP system which in turn uses Progress databases. In the old version of SQL 2000, using DTS packages, we used to set the code page via command prompts and execute DTS...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.