in reply to Re^2: Unable to find ".al" file error
in thread Unable to find ".al" file error

I'm not sure how/why my perl script is looking for it though.

Because its using AutoLoader

Replies are listed 'Best First'.
Re^4: Unable to find ".al" file error
by perlmonk1729 (Acolyte) on Oct 11, 2009 at 07:49 UTC
    Hi,

    I guess it is used/invoked internally by perl. To avoid it, I put a "no AutoLoader;" at the start of my script, but the problem still persists.

      I think you'll find that the error message is a red herring.
      The problem is probably simply that the function can't be found.

      Under certain circumstances (depending upon how you've loaded Exporter and DynaLoader), if the foo function can't be found, perl then goes looking for foo.al. If foo.al can't be found, perl then complains about the absence of foo.al (though the sane thing to do would be to complain about the inability to find the foo function).

      I'm quite confident that once you work out why the function can't be found and fix that problem, the error will go away.

      Is the function you're trying to call exported ? Can you successfully call it by it's fully qualified name (ie MyModule::foo()) ?

      Here's an Inline::C demo of the issue:
      use warnings; use Inline C => <<'EOC'; void greet() { printf("Hello World\n"); } EOC greet_me();
      Run that and you'll get the message that greet_me.al can't be found. Obviously, the complaint should be that there's no such function as greet_me().

      Cheers,
      Rob
      The error reg the ".al" turned out to be a dumb mistake in the swig interface file (.i file). Instead of "%include myheader.h", I had typed "#include myheader.h".

      Now onto real problems :-)