in reply to sub not executed

I have removed non significant code that... could be significant

I'd bet that the root cause of the problem is code that you removed. In particular, in the query that you're constructing and executing. It's perfectly reasonable for an SQL query to execute without error, yet still return no rows. If that happens, your sub wouldn't be called.

Start there. Put in enough debugging code to examine the query that you're producing, then try running that query by hand using whatever command-line client your database provides (e.g., "mysql" if you're using MySQL).

Replies are listed 'Best First'.
Re: Re: sub not executed
by Fletch (Bishop) on Feb 10, 2003 at 20:35 UTC

    Consider also enabling tracing on your DBI statement handles (perldoc DBI, look for the trace() method). Setting that to a value of 2 usually will produce a fairly detailed transcript of what's going to the database and what's coming back from it (which can help further localize where your problem is).

Re: Re: sub not executed
by pcouderc (Monk) on Feb 12, 2003 at 09:24 UTC
    Thank you. Anyway, this is not my problem as my variable $ligcnt shows that many records are fetched. Moreover many times, it works correctly and FillListe is called. It is only when you truly need the result that FillListe is not called (but I think this is Murphy's law).