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

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top