use strict; use warnings; use Math::BigInt; print "Enter a Number:"; my $input = ; chomp($input); my $tester=Math::BigInt->new($input); die "Not a Number" if $tester =~ /^[^+]|[^0-9+]/; my $power = length($tester) - 1; my $val = Math::BigInt->new(0); my @num_array = split //,$tester; foreach my $curr_numb (1 .. $#num_array) { my $curr_val = Math::BigInt->new($num_array[$curr_numb]); $curr_val = $curr_val ** $power; $val += $curr_val; } $val eq $tester ? print "$tester is narc\n" : print "Nope!";