develooper Front page | perl.perl5.porters | Postings from February 2003

Fix for Inline::Files/IO::Handle conflict

Thread Next
From:
Joe McMahon
Date:
February 25, 2003 10:37
Subject:
Fix for Inline::Files/IO::Handle conflict
Message ID:
3C540C3F-48F0-11D7-8E65-000393BCA0FC@ibiblio.org
This patch fixes the following:

bomb.pl:

#!/usr/bin/perl -w
use strict;
use Inline::Files;
use IO::Handle ();
print "won't get here\n";

when executed, we get
Too many arguments for Inline::Files::Virtual::vf_truncate at 
/System/Library/Perl/darwin/IO/Handle.pm line 424, near "])"
BEGIN not safe after errors--compilation aborted at 
/System/Library/Perl/darwin/IO/Handle.pm line 594.
Compilation failed in require at /Users/joe/bomb.pl line 4.
BEGIN failed--compilation aborted at /Users/joe/bomb.pl line 4.

This fixes the problem.

patch:
--------------------------- begin patch --------------------------------
--- /System/Library/Perl/darwin/IO/Handle.pm.old        Tue Feb 25 
13:27:11 2003
+++ /System/Library/Perl/darwin/IO/Handle.pm    Tue Feb 25 13:32:41 2003
@@ -419,7 +419,9 @@

  sub truncate {
      @_ == 2 or croak 'usage: $io->truncate(LEN)';
-    truncate($_[0], $_[1]);
+    # Explicitly use core function so Inline::Files doesn't die with a 
"Too
+    # many arguments for Inline::Files::Virtual::vf_truncate" error.
+    CORE::truncate($_[0], $_[1]);
  }

  sub read {
----------------------------- end patch --------------------------------

  --- Joe M.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About