SriniK has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have installed the "Sys::RunALone" module manually (downloaded and install). And cpan says "Sys::RunAlone is up to date (0.12).".

running my code show error "Can't locate Sys/RunALone.pm in @INC"

Error

root@us-lamp-prd-l-grt-web:~# perl -MCPAN -e 'install Sys::RunAlone' CPAN: Storable loaded ok (v2.39) Going to read '/root/.cpan/Metadata' Database was generated on Fri, 06 Sep 2013 09:17:02 GMT Sys::RunAlone is up to date (0.12). root@us-lamp-prd-l-grt-web:~# perl test.pl Can't locate Sys/RunALone.pm in @INC (@INC contains: /etc/perl /usr/lo +cal/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/ +share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/si +te_perl .) at test.pl line 3. BEGIN failed--compilation aborted at test.pl line 3.

and my script is

#!/usr/bin/perl use Sys::RunALone; print "Srini"; __END__

Please hrlp me on this.

Replies are listed 'Best First'.
Re: Perl Module install help
by Corion (Patriarch) on Sep 06, 2013 at 09:57 UTC

    Are you on a case-sensitive file system?

    The file system (and Perl) make a distinction between

    Sys::RunALone # upper case "L"
    and
    Sys::RunAlone # lower case "l"

    Once you fix that in your script, you'll find that error gone.

    You could also have found that yourself from the error message:

    Can't locate Sys/RunALone.pm in @INC (...)

    If you search for the file RunALone.pm, you will find that in fact it is not there, which should have told you that there is a subtle difference in what you ask for and what actually exists.

Re: Perl Module install help
by space_monk (Chaplain) on Sep 06, 2013 at 09:57 UTC
    Simples:
    runALone != runAlone (case sensitive!!!)
    Update: see Corions answer for a more detailed answer - my short answer was to quickly help you find the problem!
    If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)
Re: Perl Module install help
by Khen1950fx (Canon) on Sep 06, 2013 at 15:18 UTC
    It's obvious that you were emulating the author's RunAlone.t. The response you got was exactly the response that the author was testing. She used __END__ only in that specific instance; also, she deliberately misspelled the module name to test the error message. If you wanted your script to throw an exception, then it's correct. To get rid of the error, spell the module name correctly. Your test won't throw an exception then. This worked for me:
    #!/usr/bin/perl -l # test.pl use strict; use warnings; use Sys::RunAlone; print "Srini"; __END__