For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2006 > Re: tracing "Subroutine ** redefined at " warnings









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: tracing "Subroutine ** redefined at " warnings
nobull67@gmail.com

2006-10-20, 6:56 pm



On Oct 20, 12:35 pm, rampra...@nsmailserv.com (Rampra A Padmanabhan)
wrote:
> I am getting warnings like ( when I run perl -wc )
>
> Subroutine foo redefined at bar.pm.


I am guessing[1] you are doing something like

perl -wc bar.pm

This attempts to synax check bar.pm by compiling it as if it were a
script, not a module. Often this makes no difference but if bar.pm is
part of a cyclical module dependancy then you'll get redefined warnings
for all the subroutines in bar.pm because bar.pm will get loaded as a
module too.

Check modules with

perl -Mbar -ce1

Or

perl -ce"use bar"

You may also want to specify -w but really each source file should
contain "use warnings".

[1] I should not have had to guess. You should have reduced your
problem to a minimal but complete test case and posted it here.
Together with the actual output you were getting.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com