With the first incantation, obviously $pocus to rounded to 2 and the array is cut down to only 0..2 elements. The other two, I'm not sure what's happening.
#!/usr/bin/perl -w use strict; my(@hocus,$pocus); @hocus=qw(rabbit_0 rabbit_1 rabbit_2 rabbit_3); $pocus= 1.9999999999999999; &saymagicword; &prestochango; $pocus= 1.9999999999999998; &saymagicword; &prestochango; $pocus= 0.9999999999999999; &saymagicword; &prestochango; sub saymagicword{$#hocus=$pocus}; sub prestochango{print("@hocus");print(" (0-$pocus)\n");};

Replies are listed 'Best First'.
Re: Second attempt... Rounding Rabbits
by japhy (Canon) on Jan 18, 2002 at 03:56 UTC
    bleadperl results in:
    rabbit_0 rabbit_1 rabbit_2 (0-2) rabbit_0 rabbit_1 rabbit_2 (0-2) rabbit_0 rabbit_1 (0-1)
    Whereas 5.005_03 results in:
    rabbit_0 rabbit_1 rabbit_2 (0-2) rabbit_0 rabbit_1 (0-2) rabbit_0 (0-1)
    C'est la vie.

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;