Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Can't find function in @INC

by amon (Scribe)
on May 04, 2014 at 18:28 UTC ( #1084959=note: print w/replies, xml ) Need Help??


in reply to Can't find function in @INC

You are absolutely correct. The error “Can't locate Module.pm in @INC” exists, but AFAIK no such error message referring to functions does. So there are two and a half possibilities:

  • It is a trick question to test your knowledge of Perl. Explain how a similar error regarding modules does exist, and what the role of @INC is.
  • The question contains a mistake. This is the most likely explanation, considering that perldiag has no entry for such an error message.
  • There is some surprising new behavior in Perl which neither you nor I am not aware of. While possible, this isn't exactly the most likely explanation.

Replies are listed 'Best First'.
Re^2: Can't find function in @INC
by LanX (Archbishop) on May 04, 2014 at 20:13 UTC
    > This is the most likely explanation, considering that perldiag has no entry for such an error message.

    hmm did you notice that Can't locate Module.pm in @INC is not in perldiag?

    The corresponding error is only called Can't locate %s

    Which means searching for '@INC' wouldn't help...

    Though you're right about the full message:

    perl -Mdiagnostics -Mdummy Can't locate dummy.pm in @INC (@INC contains: /etc/perl /usr/local/lib +/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/p +erl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl + .). BEGIN failed--compilation aborted (#1) (F) You said to do (or require, or use) a file that couldn't be found. Perl looks for the file in all the locations mentioned in @ +INC, unless the file name included the full path to the file. Perhaps +you need to set the PERL5LIB or PERL5OPT environment variable to say w +here the extra library is, or maybe the script needs to add the library + name to @INC. Or maybe you just misspelled the name of the file. See perlfunc/require and lib.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      LanX meet splain
      Can't locate Module.pm in @INC Can't locate Module.pm in @INC (#1) (F) You said to do (or require, or use) a file that couldn't be fo +und. Perl looks for the file in all the locations mentioned in @INC, un +less the file name included the full path to the file. Perhaps you nee +d to set the PERL5LIB or PERL5OPT environment variable to say where +the extra library is, or maybe the script needs to add the library nam +e to @INC. Or maybe you just misspelled the name of the file. See "require" in perlfunc and lib.
        Off-topic?!?

        Or how does splain help to find error-msgs close to Can't find function in @INC?

        > echo "Can't find function in @INC"|splain Can't find function in @INC

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2019-12-09 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?