Solved

input from command prompt

Posted on 1998-12-13
2
168 Views
Last Modified: 2010-03-05
I have an exe running which helps me to add user email via
form and if same user is present it sents error  so my question is if how do I catch the above error since error comes at command prompt??
0
Comment
Question by:palanvinod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1206935
$result = `program.exe parameters`; # notice the backticks!

Check if $result is some kind of error message. For example you could use
if ($result =~ /error/) {
  # There was an error
}

Martin
0
 

Accepted Solution

by:
Thomy earned 50 total points
ID: 1206936
You can open a pipe with perl instead executing it with system or backticks. You execute your program and read the stdout from it.

open (DATE, "date.exe |") or die "Can't open date.exe";
while (<DATE>) {
    $out .= $_;
}
close(DATE);
# do something with $out
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question