in reply to Re: Re7: Error module
in thread Error module

Yeah, I see a number of things wrong.
  1. Don't code as root. In fact, don't EVER do anything as root unless you absolutely have to. It's dangerous and stupid.
  2. Don't code in /usr/local/bin. In fact, don't code in a bin directory. Ever. Code in some source directory, preferably in a directory under your home directory. I have a directory called 'perl' that I work in.

Given that you aren't going to fix the above issues before testing this again, I would add use lib qw(/usr/local/bin); above the use MyErrors::SomeError; line. Normally, you run the perl script from the directory it's in. This allows modules that are in that directory (or subdirectories from it) to be auto-included. (This is really nice once you have a proper development environment set up.)

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re9: Error module
by hotshot (Prior) on Aug 19, 2003 at 15:57 UTC
    I already moved the sorces to my home exactly as you said before I posted the node (of course it screamed the same). Now it gives the same error about Error/Simple.pm.

    P.S: about the root permissions, I can't avoid that since my original script is of course a lot complex and changes Linux internal files

    Hotshot
      The problem is that your @INC array doesn't contain all the directories it needs to contain. Find the directory where Error/Simple.pm is contained, then do a use lib on it.

      Look - you're going to simply have to learn how to use packages. I can't be putting fires out for you via PM. If you want, you can hire me to do your Perl programming for you. Either /msg me here or email me at rkinyon@columbus.rr.com. I have very reasonable rates.

      P.S: If you're testing a new feature out, don't do it in your production script. Create a test script and never run those as root, unless you have to.

      ------
      We are the carpenters and bricklayers of the Information Age.

      The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

      Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.