$rocks[0] = 'bedrock'; #One element... $rocks[1] = 'slate'; #another... $rocks[2] = 'lava'; #and another... $rocks[3] = 'crushed rock'; #and another... $rocks[99] = 'schist'; #now there are 95 undef elements #### $end = $#rocks; #99, which is the last element's index $number_of_rocks = $end + 1 #okay, but you'll see a better way later $rocks[$#rocks] = 'hard rock' #the last rock #### #!/usr/bin/perl use strict; use warnings; print "Type in a string: \n"; chomp ($string = ); $string.=' '; print "Type in a number: \n"; chomp ($int = ); if ($int >= 100) { print "Whoa, too big man.\n"; } else { print "The result is \n", $string x $int,"\n"; }