use Modern::Perl; my $sum_of_used; { no warnings qw/numeric uninitialized/; $sum_of_used += (split /\s+/)[2] while ; } say $sum_of_used; __DATA__ Filesystem total used avail capacity Mounted on /vol/vol0/ 142606336KB 5274244KB 137332092KB 4% /vol/vol0/ /vol/vol0/.snapshot 35651584KB 923524KB 34728060KB 3% /vol/vol0/.snapshot /vol/vobstore/ 734003200KB 6335232KB 727667968KB 1% /vol/vobstore/ /vol/vobstore/.snapshot 183500800KB 260200KB 183240600KB 0% /vol/vobstore/.snapshot /vol/ccase/ 125829120KB 21814420KB 104014700KB 17% /vol/ccase/ /vol/ccase/.snapshot 31457280KB 90572KB 31366708KB 0% /vol/ccase/.snapshot /vol/viewstore/ 943718400KB 6492604KB 937225796KB 1% /vol/viewstore/ /vol/viewstore/.snapshot 235929600KB 137500KB 235792100KB 0% /vol/viewstore/.snapshot /vol/viewstore_win/ 67108864KB 480KB 67108384KB 0% /vol/viewstore_win/ /vol/viewstore_win/.snapshot 16777216KB 2372KB 16774844KB 0% /vol/viewstore_win/.snapshot