develooper Front page | perl.perl5.porters | Postings from March 2000

POSIX/Fcntl/IO::Seekable exports clash

Thread Next
From:
Gurusamy Sarathy
Date:
March 14, 2000 12:40
Subject:
POSIX/Fcntl/IO::Seekable exports clash
Message ID:
200003142039.MAA12650@maul.ActiveState.com

    % ./perl -Ilib -we 'use POSIX; use IO::File;'
    Prototype mismatch: sub main::SEEK_SET vs () at lib/Exporter.pm line 57.
	    Exporter::import('SEEK_SET', 'SEEK_CUR', 'SEEK_END', 'O_ACCMODE', 'O_ALIAS', 'O_APPEND', 'O_ASYNC', 'O_BINARY', ...) called at -e line 1
	    main::BEGIN() called at lib/IO/File.pm line 1
	    require 0 called at lib/IO/File.pm line 1
    Prototype mismatch: sub main::SEEK_CUR vs () at lib/Exporter.pm line 57.
	    Exporter::import('SEEK_SET', 'SEEK_CUR', 'SEEK_END', 'O_ACCMODE', 'O_ALIAS', 'O_APPEND', 'O_ASYNC', 'O_BINARY', ...) called at -e line 1
	    main::BEGIN() called at lib/IO/File.pm line 1
	    require 0 called at lib/IO/File.pm line 1
    Prototype mismatch: sub main::SEEK_END vs () at lib/Exporter.pm line 57.
	    Exporter::import('SEEK_SET', 'SEEK_CUR', 'SEEK_END', 'O_ACCMODE', 'O_ALIAS', 'O_APPEND', 'O_ASYNC', 'O_BINARY', ...) called at -e line 1
	    main::BEGIN() called at lib/IO/File.pm line 1
	    require 0 called at lib/IO/File.pm line 1

I have hacked in the attached nasty, but a better fix would be
welcome.

We desperately need a proper way to autoload constants (I mean, with a
prototype of () and all).  If someone has tuits, please consider
working on that problem.


Sarathy
gsar@ActiveState.com
-----------------------------------8<-----------------------------------
Change 5738 by gsar@auger on 2000/03/14 20:34:19

	kludge our way around warnings on C<use POSIX; use IO::File;>

Affected files ...

... //depot/perl/ext/IO/lib/IO/Seekable.pm#9 edit

Differences ...

==== //depot/perl/ext/IO/lib/IO/Seekable.pm#9 (text) ====
Index: perl/ext/IO/lib/IO/Seekable.pm
--- perl/ext/IO/lib/IO/Seekable.pm.~1~	Tue Mar 14 12:34:24 2000
+++ perl/ext/IO/lib/IO/Seekable.pm	Tue Mar 14 12:34:24 2000
@@ -48,7 +48,10 @@
 use Carp;
 use strict;
 our($VERSION, @EXPORT, @ISA);
-use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END);
+use IO::Handle ();
+# XXX we can't get these from IO::Handle or we'll get prototype
+# mismatch warnings on C<use POSIX; use IO::File;> :-(
+use Fcntl qw(SEEK_SET SEEK_CUR SEEK_END);
 require Exporter;
 
 @EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END);
End of Patch.

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