#!/usr/bin/perl use strict; use warnings 'all'; my $sum = 0; $sum += $_ for @ARGV; map {$_ *= 100 / $sum} @ARGV; print "@ARGV\n";