in reply to splitting a decimal number..

This solution is far from perfect, but it *works* (as long as the number stringifies normally)

my ($y, $z) = split /\./, $x;
Sometimes you can get away with doing stringy things on numbers. It can be a time saver if you're in a hurry and out of inspiration.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Replies are listed 'Best First'.
Re^2: splitting a decimal number..
by renz (Scribe) on Jan 05, 2005 at 23:00 UTC
    That's close to how I was trying to do it, but occasionally was yielding some strange results depending on the data I fed to it. Anyway, I've got it worked out now.

    /bwb.