#!/usr/bin/perl # # Name : Matthew Reeves # # breaks apart a 5 digit number # #use diagnostics; use warnings; use strict; #prompt user for five-digit number, chomp newline print("\nPlease enter a five-digit number: "); my $num = <>; chomp $num; #shave off each digit of number, store in separate scalars my $dig5 = chop $num; my $dig4 = chop $num; my $dig3 = chop $num; my $dig2 = chop $num; my $dig1 = chop $num; #print individual digits, separated by 3 spaces print "\n$dig1 $dig2 $dig3 $dig4 $dig5\n\n";