Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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

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/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?
[LanX]: What about Czech an Chechen ambessy?
[AnomalousMonk]: LanX: Rama had (has?) a high (much higher than typical asteroid) rate of axial (again, unusual, I think) spin for its artificial gravity.
LanX pity there is no Germs embassy ...
[choroba]: LanX We merged them to save money.
[LanX]: AnomalousMonk: yeah the asteroid but not the god, right?

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2017-11-22 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (327 votes). Check out past polls.

    Notices?