in reply to Re: Linux::Inotify2, adding sub-dirs to watches event-triggered...
in thread Linux::Inotify2, adding sub-dirs to watches event-triggered...

Good Explanation. I haven't tried both the code but it educates me lot.
Thanks Marshall
  • Comment on Re^2: Linux::Inotify2, adding sub-dirs to watches event-triggered...

Replies are listed 'Best First'.
Re^3: Linux::Inotify2, adding sub-dirs to watches event-triggered...
by Marshall (Canon) on Nov 19, 2010 at 14:45 UTC
    Thanks for the compliment! I am happy to hear that somebody is learning something from this - I actually did too!

    I don't know that you will ever need to use Linux::Inotify2 or not. But, you may need to install some other module on your Linux system without root permission. Here's how I did it... Keep in mind that I am using a student account which has the lowest permission levels on the planet!

    I started with looking at the tutorials: don't have permission?. The first step is to make the directory that your "private Perl library" will reside in. I just used the suggested name of "lib".

    Now things diverge a bit from the tutorial.. I just typed "cpan" at the command prompt. That was already a command and I didn't have to do anything special. This will create a .cpan directory and start asking a bunch of questions (in UNIX a file name that beings with "." is a "hidden file" - so you will have to use "ls -al" or some such to see it in a directory listing).

    When this dialog gets to a question about PREFIX, that's where you type in "PREFIX=~/lib LIB=~/lib", re:the tutorial. I think all of the other defaults were ok on my test machine except for the question about mirrors, enter one or more mirror sites specified by number - otherwise just hit enter.

    I didn't see this in the tut, probably there but I missed it. However, I found that I needed to set the PERL5LIB environment variable to get the 'install Linux::Inotify2' command to work from the cpan application. The "make" needs to find common/sense.pm

    This student account uses the bash shell, so I modified the file .bash_profile by adding:
    PERL5LIB=$HOME/lib:$HOME/lib/common
    export PERL5LIB
    at the end of it.
    This results in:
    [tmp2604@mymachine~]$ env | grep -i Perl
    PERL5LIB=/home/student/tmp2604/lib:/home/student/tmp2604/lib/common

    I don't know if adding /common to the path was necessary or not - at the time I didn't worry about it and actually I'm still not worried about it - searching will stop once "make" finds what it needs.

    At the end of the day, installing this special module wasn't THAT hard. I had to mess around a bit, but it works.