#!/usr/bin/env perl use strict; use warnings; my @nums = ( 5, 10, 15, 20, 25 ); # Loop through the array to add each number, one at a time to make the total. my $totalSum = 0; for my $num ( @nums ) { $totalSum += $num; } # Map loops through a list, applying a block to each item, to create a new list my @array = map { $_ / $totalSum } @nums; print "The required numbers are: @array";