Index: subversion/bindings/swig/core.i
===================================================================
--- subversion/bindings/swig/core.i	(revision 141)
+++ subversion/bindings/swig/core.i	(revision 142)
@@ -216,30 +216,7 @@
     }
 }
 %typemap(perl5, in) FILE * {
-    dSP ;
-    int count, fd ;
-
-    ENTER ;
-    SAVETMPS;
-
-    PUSHMARK(SP) ;
-    XPUSHs($input);
-    PUTBACK ;
-
-    count = call_pv("fileno", G_SCALAR);
-    SPAGAIN ;
-
-    if (count != 1)
-        croak("Wrong number of returns from fileno") ;
-
-    if ((fd = POPi) < 0)
-        croak("not an accessible filehandle");
-
-    $1 = fdopen (fd, "r+");
-
-    PUTBACK ;
-    FREETMPS ;
-    LEAVE ;
+    $1 = PerlIO_exportFILE (IoIFP (sv_2io ($input)), NULL);
 }
 
 /* -----------------------------------------------------------------------


