Index: slice.pod
--- slice.pod.orig	2002-02-10 23:41:42.000000000 +0100
+++ slice.pod	2013-07-04 19:48:56.149262840 +0200
@@ -24,7 +24,7 @@
 =head2 Input Principle
 
 The F<slice> program reads I<inputfile> (or from F<STDIN> if I<inputfile> is
-not given or equal ``C<->'') and divides its already prepared ASCII contents
+not given or equal C<->) and divides its already prepared ASCII contents
 into possibly overlapping areas, called I<slices>.   These slices are
 determined by enclosing blocks defined by begin and end delimiters which have
 to be I<already> in the file. These block delimiters use the syntax
@@ -38,7 +38,7 @@
 
 
 The I<NAME> identifier has to match against the regular expression
-``C<[_A-Z0-9]+>'', i.e. I<NAME> is a string consisting only of uppercase
+C<[_A-Z0-9]+>, i.e. I<NAME> is a string consisting only of uppercase
 letters, digits or underscore characters.
 
 There can be as many such slice definitions as you like and there can be more
@@ -57,7 +57,7 @@
 =item SLICE_TERM ::= C<NAME>
 
 The slice NAME itself. This name has to match against the regex
-``C<[_A-Z0-9*{}]+>''. Here two cases are possible: C<NAME> is either a plain
+C<[_A-Z0-9*{}]+>. Here two cases are possible: C<NAME> is either a plain
 slice name consisting only of uppercase letters, digits or an underscore
 character. Or it is a wildcarded slice name indicated by an asterisk
 character. 
@@ -213,8 +213,8 @@
 
 The optional I<chmodcmd> string is intended for specifying options for the
 F<chmod> command, which is applied to I<outputfile> after writing. For
-instance use ``C<a+r>'' to make sure the file is readable by a webserver of
-``C<u+x>'' to create a file with the execution bit set (usually used for SSI
+instance use C<a+r> to make sure the file is readable by a webserver of
+C<u+x> to create a file with the execution bit set (usually used for SSI
 files on a webserver with the C<XBitHack> option available).
 
 The optional I<outputpolicy> string allows changing output policy for
@@ -335,7 +335,7 @@
 
 =head1 RESTRICTION
 
-The current implementation only handles anonymous end delimiters ``C<:]>''
+The current implementation only handles anonymous end delimiters C<:]>
 correct in clear cases where no mis-interpretation is possible, i.e. when no
 overlapping occurs. For instance in
 
Index: slice_pass3.pl
--- slice_pass3.pl.orig	2002-02-10 22:49:45.000000000 +0100
+++ slice_pass3.pl	2013-07-04 19:48:10.225096816 +0200
@@ -92,11 +92,13 @@
         #   skip file if requested by options
         if ($status->{z} > 0 and $out eq '') {
                 printwarning("Empty output: skip generation of $outfile\n");
-                next if $status->{z} > 1;
+                main::error("Execution stopped\n") if $status->{z} > 2;
+                next if $status->{z} == 2;
         }
         if ($status->{s} > 0 and ($out eq '' or $out !~ m/\S/)) {
                 printwarning("Whitespace only: skip generation of $outfile\n");
-                next if $status->{s} > 1;
+                main::error("Execution stopped\n") if $status->{s} > 2;
+                next if $status->{s} == 2;
         }
 
         #   open output file
@@ -104,9 +106,12 @@
             print $out;
         }
         else {
-            open(OUT, ">$outfile");
-            print OUT $out;
-            close(OUT);
+            open(OUT, ">$outfile")
+                or main::error("Unable to write into $outfile: $!\n");
+            print OUT $out
+                or main::fileerror($outfile, "Unable to write into $outfile: $!\n");
+            close(OUT)
+                or main::fileerror($outfile, "Unable to close $outfile: $!\n");
         }
 
         #   additionally run chmod on the output file
Index: slice_setup.pl
--- slice_setup.pl.orig	2002-01-12 22:22:18.000000000 +0100
+++ slice_setup.pl	2013-07-04 19:48:10.225096816 +0200
@@ -75,17 +75,21 @@
     #   read input file
     if (($#ARGV == 0 and $ARGV[0] eq '-') or $#ARGV == -1) {
         $fp = new IO::Handle;
-        $fp->fdopen(fileno(STDIN), "r");
+        $fp->fdopen(fileno(STDIN), "r")
+            || error("Unable to load STDIN: $!\n");
         local ($/) = undef;
         $INPUT = <$fp>;
-        $fp->close;
+        $fp->close()
+            || error("Unable to close STDIN: $!\n");
     }
     elsif ($#ARGV == 0) {
         $fp = new IO::File;
-        $fp->open($ARGV[0]);
+        $fp->open($ARGV[0])
+            || error("Unable to load $ARGV[0]: $!\n");
         local ($/) = undef;
         $INPUT = <$fp>;
-        $fp->close;
+        $fp->close()
+            || error("Unable to close $ARGV[0]: $!\n");
     }
     else {
         usage();
Index: slice_util.pl
--- slice_util.pl.orig	2002-01-12 22:23:15.000000000 +0100
+++ slice_util.pl	2013-07-04 19:48:10.225096816 +0200
@@ -29,6 +29,15 @@
     exit(1);
 }
 
+sub fileerror {
+    my $file  = shift;
+    my ($str) = @_;
+
+    printerror($str);
+    unlink $file;
+    exit(1);
+}
+
 sub printwarning {
     my ($str) = @_;
 
