in reply to Re^3: Printing the length of an array ?
in thread Printing the length of an array ?

That can be wrong for at least one very bad reason that you should be glad you don't know. This code is always correct, shorter, and less noisy:

my $count = @array;

Replies are listed 'Best First'.
Re^5: Printing the length of an array ?
by shmem (Chancellor) on Mar 30, 2008 at 22:08 UTC
    That can be wrong for at least one very bad reason that you should be glad you don't know.

    That's so chromatic... and, of course, it does induce a post asking: what bad reason?

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      what bad reason?
      $[ = 42;
Re^5: Printing the length of an array ?
by wardy3 (Scribe) on Mar 31, 2008 at 04:39 UTC
    oooooh, but i want to know