Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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 You can put the following code right below the package statement.

BEGIN { $INC{""} ||= __FILE__ }

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


Replies are listed 'Best First'.
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/, 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/"} ||= File::Spe +c->rel2abs(__FILE__); }

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2021-10-21 06:24 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (82 votes). Check out past polls.