in reply to Re: Elements added to hash in for loop
in thread Elements added to hash in for loop

... you are using the length of @_ as key ...

nathaniels: This raises the question: Under what circumstances are you calling the  next_clauseid() function with zero parameters?!?

I hope that you  usewarnings   so that if you employ the common parameter passing conventions advised by LanX and 2teez, you will at least receive a warning message from Perl in case of such a lapse.

Replies are listed 'Best First'.
Re^3: Elements added to hash in for loop
by LanX (Saint) on Dec 13, 2013 at 15:15 UTC
    I'm not nathaniels, but ...

    > I hope that you use warnings so that if you employ the common parameter passing ... you will at least receive a warning message from Perl in case of such a lapse.

    which warning?

    DB<102> use warnings;use strict; sub tst { my $scalar=@_; print $sca +lar } DB<103>

    =)

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      >perl -le "use warnings; use strict; sub tst { my ($scalar) = @_; print $scala +r } tst " Use of uninitialized value $scalar in print at -e line 1.

      That warning :)

Re^3: Elements added to hash in for loop
by nathaniels (Acolyte) on Dec 14, 2013 at 23:56 UTC
    Where can I find these conventions?

      The replies of LanX and 2teez in this thread pretty much say it all. But take a look at what perlsub has to say about parameter passing (in various sections), and at the Function Parameters sub-section in chromatic's very good Modern Perl (chromatic's user node has a link to a free download link).

        thanks!