Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Circular dependencies when using the perl syntax checker

by tsee (Curate)
on Dec 01, 2008 at 15:08 UTC ( #727113=note: print w/ replies, xml ) Need Help??


in reply to Circular dependencies when using the perl syntax checker

This is a bit of a late post, but I've just stumbled on this thread because I had the same problem. Other posts explained the cause of it, so I won't go into that. I'd just like to point out a workaround which seems to work for me: Say, we have module Foo which resides in its own file Foo.pm. You can put the following code right below the package statement.

BEGIN { $INC{"Foo.pm"} ||= __FILE__ }

Essentially, this forces an entry in %INC when the file is compiled. Use with care.

Cheers,
Steffen


Comment on Re: Circular dependencies when using the perl syntax checker
Download Code
Re^2: Circular dependencies when using the perl syntax checker
by rlucas (Scribe) on Nov 14, 2009 at 02:22 UTC
    I had this specific problem with Class::MethodMaker as well. Perhaps because I had my files inside of subdirs (e.g. My::Module in My/Module.pm), Steffen's fix didn't work. I had to take another step, and make sure I had the filename just so:

    BEGIN { use strict; use File::Spec; $INC{"My/Module.pm"} ||= File::Spe +c->rel2abs(__FILE__); }

    (OK, the "use strict" is just a bit of belt-and-suspenders ;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://727113]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-08-28 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls