#!/usr/bin/perl use strict; use warnings; my $count; print "Count: "; $count = ; chomp($count); # use repetition operator to print that number of '=' chars print "=" x $count . "\n"; # declare an array and resize it to the number of elements specified my @numbers; $#numbers = ($count - 1); # @numbers in scalar context returns the size of the array, # we repeat the list 0 that number of times and assign the list to the array @numbers = (0) x @numbers; # print the array foreach my $i (@numbers) { print "$i\n"; }