Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: How to split an integer??

by McDarren (Abbot)
on Dec 06, 2012 at 11:28 UTC ( [id://1007538] : note . print w/replies, xml ) Need Help??


in reply to Re^4: How to split an integer??
in thread How to split an integer??

my $number = 23; my @bits = split //, $number; my $total; for my $bit (@bits) { $total += $bit; } print "Number=$number Total=$total\n";