Assorted 2.15 fixes.
[p5sagit/p5-mst-13.2.git] / ext / Encode / t / perlio.t
index ed16796..012bbe6 100644 (file)
@@ -122,7 +122,10 @@ for my $src (sort keys %e) {
                dump2file("$pfile.$seq", $dtext);
            }
        }
-       $DEBUG or unlink ($sfile, $pfile);
+     if ( ! $DEBUG ) {
+            1 while unlink ($sfile);
+            1 while unlink ($pfile);
+        }
     }
 }
 
@@ -146,7 +149,7 @@ SKIP:{
     # reading
     for my $utf (sort keys %bom){
        my $bomed = $bom{$utf} . encode($utf, $str);
-       my $sfile = File::Spec->catfile($dir,".$utf.$seq.$$");
+       my $sfile = File::Spec->catfile($dir,".${utf}_${seq}_$$");
        dump2file($sfile, $bomed);
        my $utf_nobom = $utf; $utf_nobom =~ s/(LE|BE)$//o;
        # reading
@@ -159,12 +162,12 @@ SKIP:{
     # writing
     for my $utf_nobom (qw/UTF-16 UTF-32/){
        my $utf = $utf_nobom . 'BE';
-       my $sfile = File::Spec->catfile($dir,".$utf_nobom.$seq.$$");
+       my $sfile = File::Spec->catfile($dir,".${utf_nobom}_${seq}_$$");
        my $bomed = $bom{$utf} . encode($utf, $str);
        open  $fh, ">:encoding($utf_nobom)", $sfile or die "$sfile : $!";
        print $fh $str;
        close $fh;
-       open my $fh, "<:raw", $sfile or die "$sfile : $!";
+       open my $fh, "<", $sfile or die "$sfile : $!";
        read $fh, my $cmp, -s $sfile;
        close $fh;
        use bytes ();