in reply to trapping system error
#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Debug; use CGI::Carp qw( fatalsToBrowser ); BEGIN { sub carp_error { my $error_message = shift; my $q = new CGI; $q->start_html( "Not able to create directory" ), $q->h1( "Error" ), $q->p( "Not able to create directory" ), $q->p( $q->i( $error_message ) ), $q->end_html; } CGI::Carp::set_message( \&carp_error ); } system("mkdir -p test"); if ($@) { print "Not able to create directory\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: trapping system error
by anu_1 (Acolyte) on Aug 28, 2010 at 11:38 UTC | |
|
Re^2: trapping system error
by thargas (Deacon) on Aug 31, 2010 at 13:19 UTC |