Display error message if an error occurs on "open" command

G

Geek

How can I get the following code to display a meaningful error message if
the "open" command doesn't succeeed?

$blatString = "\|C:\WINNT\SYSTEM32\blat.exe
\"d:\temp\message_body.txt\" -t \"(e-mail address removed)\" -s \"This is a
test\" -f \"(e-mail address removed)\" -i \"Web Server\" -server mail.nowhere.com
d:\temp\~blatoutput.txt";

open (MAIL2, $blatString));

I'd like something that displays the actual error encountered, not just
something like this:

$blatString = "\|C:\WINNT\SYSTEM32\blat.exe
\"d:\temp\message_body.txt\" -t \"(e-mail address removed)\" -s \"This is a
test\" -f \"(e-mail address removed)\" -i \"Web Server\" -server mail.nowhere.com
d:\temp\~blatoutput.txt";

unless (open (MAIL2, $blatString)) {
print "<p>Can't execute Blat</p>";
$BlatError = 1;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,191
Latest member
BuyKetoBeez

Latest Threads

Top