#!/usr/bin/perl -w # tester.cgi # dead simple script that hopefully won't work # as I want Perl to give me a nice informative # message, telling me why use strict; use Carp qw(cluck longmess shortmess); # example right out of perldoc my $long_message = longmess( "message from cluck() or confess()" ); # MYFILE does NOT exist my $file = "MYFILE"; # Perl, please inform me that the file MYFILE does not exist system ("cat $file" or $long_message()); #### # ./tester.cgi syntax error at ./tester.cgi line 16, near "$long_message(" Execution of ./tester.cgi aborted due to compilation errors. #### #!/usr/bin/perl -w use strict; use Carp qw(cluck longmess shortmess); my $long_message = longmess( "message from cluck() or confess()" ); my $file = "MYFILE"; system ("cat $file" or confess(),cluck(),carp()); #### cat: MYFILE: No such file or directory