You can't really do -c "use Module.pm" because of line numbers.

I think the problem is that we do a -C on a file without filling %INC
properly, so it is actually two different files being loaded.

I think this can be fixed.

Adam

On 14 March 2012 05:48, Rob Messer <rmes...@intellisurvey.com> wrote:
> Gabor,
>
> Thanks for your reply.  You're right, I did mean "subroutine redefined".
>
> Even though it wouldn't be perfect, I do think it would be better if Padre 
> did something like "perl -c -e "use Module.pm"' to syntax check .pm files.  
> It would reduce some superfluous warnings and make it closer to accurate.  
> After all, the point of the syntax checker is to tell you if your scripts and 
> modules have syntax errors, not to display "subroutine redefined" warnings 
> for things that are defined only once.  If the scripts and modules run 
> without syntax errors or warnings, then why should Padre show errors?  It's 
> just distracting and greatly reduces the value of syntax checking.  Of 
> course, this is really perhaps a problem with perl -c and not with Padre, but 
> if Padre can make developers' lives easier then it should do so.
>
> As to your suggestion that it is bad design to have circular "use" lines -- 
> that is really beside the point.  In some cases it is perfectly valid that 
> module A needs to use module B, and vice versa, and it does not necessarily 
> mean that things evolved without a design.  There are ways around it of 
> course, but if it isn't a syntax error when running, it ideally shouldn't be 
> reported as a syntax error by the Padre IDE.
>
> So it is a minor thing in the scheme of things, but it would be easy enough 
> for Padre to detect .pm files and handle syntax checking slightly differently 
> for them, so in my opinion it would be worth doing.  Regards,
>
> Rob
>
>> I guess you meant "Subroutine redefined" there as it says in the
>> PerlMonks post. Let us know if not.
>>
>> I see the discussion there and I don't think Padre could provide
>> anything else than what was recommended in that post. Well, Padre
>> could be taught to hide specific warnings for specific files but I
>> don't think it supports this currently.
>>
>> OTOH I am surprised no one on Perl Monks started to tell you that
>> circular loading of modules is not good.
>> It points to some bad design of the code. Actually such circular
>> loading comes up when the code just evolved without specific design.
>> So maybe instead of hiding this warning a better approach would be to
>> ensure you have no circular loads in your code.
>>
>> It would also make it easier to test it.
>>
>> regards
>>    Gabor
> _______________________________________________
> Padre-dev mailing list
> Padre-dev@perlide.org
> http://mail.perlide.org/mailman/listinfo/padre-dev
_______________________________________________
Padre-dev mailing list
Padre-dev@perlide.org
http://mail.perlide.org/mailman/listinfo/padre-dev

Reply via email to