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

Hi, I have a problem running a program under CentOS. So it is a big chunk of coding material separated into different modules. And the way everything is wired is so that a script is calling a Main module in local lib directory to which all other modules are connected to:
/sub1/mod2.pm Script --> ./lib/class/Main.pm /sun2/mod2.pm Script.pl use lib "./lib";
The thing is, this is running normally under Debian(perl-5.10) Debian(perl-5.8.8), Ubuntu(perl-5.10) but under CentOS(perl-5.8.8) it starts and like waiting for something to happen , like waiting for <stdin>. as soon as i comment out the line
use Class::Main;
the script exits normally. what could be the problem ??

baxy

Replies are listed 'Best First'.
Re: Problem running scripts under CentOS
by jdporter (Paladin) on Dec 14, 2011 at 18:09 UTC

    I don't know. That's pretty strange, that CentOS behavior should be so different. But I do notice an oddity in what you've given. Who knows, maybe it has something to do with it. Assuming you haven't made any typos above:

    Class::Main should be stored in lib/Class/Main.pm, but you have it in lib/class/Main.pm. On unixy OSes, filename case does matter. Try fixing that, see what happens.

    I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.
Re: Problem running scripts under CentOS
by Eliya (Vicar) on Dec 14, 2011 at 18:22 UTC
    like waiting for <stdin> ...

    Run it under strace:

    $ strace -f ./script.pl

    If the last line you see is

    read(0,

    you know it's waiting on stdin...   If not, you'll likely still be able to narrow down on the issue by looking at what system calls were being made before the script enters "waiting" mode.

Is this a BUG Re: Problem running scripts under CentOS
by baxy77bax (Deacon) on Dec 15, 2011 at 11:45 UTC
    found the problem but don't know how to solve it.

    it seams that when you use bignum library under CentOS and set accuracy to 300 everything blocks.

    use bignum accuracy => 300;
    if a omit the accuracy everything is working. What should i do? (except omitting the accuracy set - i need that to be set to 300 !!!)

    However this is working

    perl -Mbignum=a,50 -le 'print sqrt(20)'
    but this blocks the script if it is used within a module
    use bignum accuracy => 50; print sqrt(20);
    Oh and my OS
    CentOS release 5.6 (Final) cat /proc/version Linux version 2.6.18-238.19.1.el5 (mockbuild@builder10.centos.org) (gc +c version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Fri Jul 15 07:31: +24 EDT 2011