Index: languages/lua/t/package.t
===================================================================
--- languages/lua/t/package.t	(revision 19040)
+++ languages/lua/t/package.t	(working copy)
@@ -92,6 +92,9 @@
 0	1
 OUTPUT
 
+# clean up complex.lua
+unlink('../complex.lua') if ( -f '../complex.lua' );
+
 language_output_like( 'lua', << 'CODE', << 'OUTPUT', 'function require (no module)' );
 require "no_module"
 CODE
@@ -109,6 +112,9 @@
 /[^:]+: error loading module 'foo' from file '.*foo.lua':\n/
 OUTPUT
 
+# clean up foo.lua
+unlink('../foo.lua') if ( -f '../foo.lua' );
+
 language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'function require & package.preload' );
 foo = {}
 foo.bar = 1234
@@ -139,6 +145,9 @@
 OUTPUT
 }
 
+# clean up foo.lua
+unlink('../foo.lua') if ( -f '../foo.lua' );
+
 unlink('../complex.lua') if ( -f '../complex.lua' );
 open $X, '>', '../complex.lua';
 print {$X} << 'CODE';
@@ -182,6 +191,9 @@
 0	1
 OUTPUT
 
+# clean up complex.lua
+unlink('../complex.lua') if ( -f '../complex.lua' );
+
 SKIP:
 {
 skip('only with Parrot', 1) if (($ENV{PARROT_LUA_TEST_PROG} || q{}) eq 'lua');
@@ -233,6 +245,10 @@
 OUTPUT
 }
 
+# clean up mod_foo.pbc and/or mod_foo.pir if necessary
+unlink('../mod_foo.pbc') if ( -f '../mod_foo.pbc' );
+unlink('../mod_foo.pir') if ( -f '../mod_foo.pir' );
+
 language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'table package.loaded' );
 t = {}
 for k in pairs(package.loaded) do
Index: languages/lua/t/io.t
===================================================================
--- languages/lua/t/io.t	(revision 19040)
+++ languages/lua/t/io.t	(working copy)
@@ -149,6 +149,7 @@
 CODE
 /^file \((0[Xx])?[0-9A-Fa-f]+\)/
 OUTPUT
+unlink('../output.new') if ( -f '../output.new' );
 
 language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'io.read *l', params => "< file.txt"  );
 print(io.read("*l"))
@@ -179,6 +180,8 @@
 15000000000000
 1000001
 OUTPUT
+# clean up number.txt
+unlink('../number.txt') if ( -f '../number.txt' );
 
 language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'io.lines filename' );
 for line in io.lines("file.txt") do
@@ -358,6 +361,8 @@
 true
 OUTPUT
 }
+# clean up file.txt
+unlink('../file.txt') if ( -f '../file.txt' );
 
 language_output_like( 'lua', << 'CODE', << 'OUTPUT', 'file:write closed' );
 f = io.open("file.out", "w")
@@ -391,6 +396,8 @@
 closing file for you.
 OUTPUT
 }
+# clean up file.out
+unlink('../file.out') if ( -f '../file.out' );
 
 # Local Variables:
 #   mode: cperl
Index: languages/lua/t/basic.t
===================================================================
--- languages/lua/t/basic.t	(revision 19040)
+++ languages/lua/t/basic.t	(working copy)
@@ -108,6 +108,9 @@
 7.0880180586677
 OUTPUT
 
+# clean up lib1.lua
+unlink('../lib1.lua') if ( -f '../lib1.lua' );
+
 language_output_like( 'lua', << 'CODE', << 'OUTPUT', 'function dofile (no file)' );
 dofile("no_file.lua")
 CODE
@@ -125,6 +128,9 @@
 /\?/
 OUTPUT
 
+# clean up foo.lua
+unlink('../foo.lua') if ( -f '../foo.lua' );
+
 language_output_is( 'lua', <<'CODE', <<'OUT', 'function getfenv' );
 local function f () end
 
@@ -203,6 +209,9 @@
 ok
 OUTPUT
 
+# clean up foo.lua
+unlink('../foo.lua') if ( -f '../foo.lua' );
+
 language_output_like( 'lua', << 'CODE', << 'OUTPUT', 'function loadfile (no file)' );
 f, msg = loadfile("no_file.lua")
 print(f, msg)
@@ -222,6 +231,9 @@
 /nil\t.*\?/
 OUTPUT
 
+# clean up foo.lua
+unlink('../foo.lua') if ( -f '../foo.lua' );
+
 language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'function loadstring' );
 f = loadstring("i = i + 1")
 i = 0
Index: languages/lua/t/lfs.t
===================================================================
--- languages/lua/t/lfs.t	(revision 19040)
+++ languages/lua/t/lfs.t	(working copy)
@@ -207,6 +207,8 @@
 /^[^:]+: [^:]+:\d+: lock: closed file\nstack traceback:\n/
 OUT
 
+# clean up file.txt
+unlink('../file.txt') if ( -f '../file.txt' );
 
 # Local Variables:
 #   mode: cperl
Index: languages/lua/lib/luaperl.pir
===================================================================
--- languages/lua/lib/luaperl.pir	(revision 19040)
+++ languages/lua/lib/luaperl.pir	(working copy)
@@ -129,6 +129,7 @@
     if pir goto L1
     $P0 = getclass 'ParrotIO'
     $S0 = $P0.'slurp'(out)
+    unlink(out)  # cleaning up the temporary file
     .local pmc ex
     ex = new .Exception
     ex['_message'] = $S0
