Solved

input from command prompt

Posted on 1998-12-13
2
155 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
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now