CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
command prompt


New User

Dec 9, 2008, 6:44 AM

Post #1 of 3 (629 views)
command prompt Can't Post


I have a script that I run in Window with ActivePerl installed. This script basically goes to a network drive and load the file up and search for a string. I run it by doubleclicking .pl file. This runs fine and the command prompt window pops up and I'm able to input the paramater I want to search for. However, if for any reason this file is unreachable you can see the cmd window disappear without any errors. How can I have the cmd stay up so the user can see the error msg? If I run this script in cmd then obviously the error is display but again, I would like to just run the script by double clicking the icon? Any help is apperciated.

This is what I have below.

$wlog = '../wrapper.log';
open(INFO, $wlog) or die("Could not open log file. $!");



Dec 9, 2008, 9:04 AM

Post #2 of 3 (625 views)
Re: [wikeyrx] command prompt [In reply to] Can't Post

Might be better ways but here is a suggestion:

open(INFO, $wlog) or error("Could not open log file. $!"); 

sub error {
print "$_[0]\n";

You might want to look through the activeperl documentation and search for specific Windows methods of running your perl programs. I would think activeperl has a builtin method that keeps a window open.

New User

Dec 9, 2008, 9:38 AM

Post #3 of 3 (623 views)
Re: [wikeyrx] command prompt [In reply to] Can't Post

Thanks Kevin,


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives