Weird Module Interactions

R

roi.lists

If I have a program with:

use Module;
use Fcntl;
use POSIX;

Where Module.pm is:

package Module;
use Fcntl;
my $a = O_APPEND;
1;

I get:

Subroutine main::O_APPEND redefined at /usr/lib/perl5/5.8.5/Exporter.pm
line 65.
at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/POSIX.pm line 19

But when I exchange the "use Fcntl" and "use POSIX" lines, or drop the
"use Module" line, the Error disappears.

What gives?
 
S

Sisyphus

If I have a program with:

use Module;
use Fcntl;
use POSIX;

Where Module.pm is:

package Module;
use Fcntl;
my $a = O_APPEND;
1;

I get:

Subroutine main::O_APPEND redefined at /usr/lib/perl5/5.8.5/Exporter.pm
line 65.
at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/POSIX.pm line 19

But when I exchange the "use Fcntl" and "use POSIX" lines, or drop the
"use Module" line, the Error disappears.

What gives?

I don't know. For me, there's no problem with the code you have supplied -
tested on perls 5.8.4, 5.8.5 and 5.8.7.

Cheers,
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,265
Messages
2,571,069
Members
48,771
Latest member
ElysaD

Latest Threads

Top