Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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
Node Status?
node history
Node Type: note [id://727113]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2018-07-19 17:50 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (414 votes). Check out past polls.