Message while using modlues
tamaguchi
created: 2006-05-02 09:24:02
I before I had a larger program with many subrutines. Now I have taken them out and created a module out of them. When I try to run the program for each subrutine in the module I get the error(?) message:


Subrutine xxx redefined at C:/... program line ..


Do you perhaps know why this message appears?
Re: Message while using modlues
created: 2006-05-02 09:26:56
You seem to be loading a file more than once that defines functions. That shouldn't really happen. Are you doing do "somefile.pl" to load the function definitions? If so, you shouldn't be. You should be using require "somefile.pl" instead. But then again, you haven't shown any code at all, so I could be entirely wrong.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
Re^2: Message while using modlues
created: 2006-05-02 09:32:49
Hmm.. now I know that you for your help.
Re: Message while using modlues
created: 2006-05-02 13:09:04
You can use diagnostics module to understand many warnings and errors...

Using this code:

use warnings;
use strict;

sub a{ 1 };
sub a{ 2 };

Diagnostics says:

$ perl -Mdiagnostics x
Subroutine a redefined at x line 6 (#1)
    (W redefine) You redefined a subroutine.  To suppress this warning, say

        {
        no warnings 'redefine';
        eval "sub name { ... }";
        }

.............

--
Marco Antonio
Rio-PM

perlmonks.org content © perlmonks.org and japhy, mda2, tamaguchi

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03