Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Perl Module install help

by SriniK (Beadle)
on Sep 06, 2013 at 09:54 UTC ( [id://1052682]=perlquestion: print w/replies, xml ) Need Help??

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__

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1052682]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2025-12-07 00:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (85 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.