in reply to Re: Cube/digit script.
in thread Cube/digit script.

Here, I figured out what was wrong.
The $added variable was unnecessary:
use strict; use warnings; my $i; my $j; my $cubed; my @num; my @numbers; for $i(100..999){ undef($cubed); undef(@num); @num=split(//, $i); for $j(@num){ $cubed+=$j**3; } if($cubed==$i){ push @numbers, $i; } } print "$_\n" for @numbers;
Thanks for the help!