use strict; use warnings; my %const; #Initialise params $const{pid} = 1; $const{pidwithzeros} = '0' x (10 - length $const{pid}) . $const{pid }, #Check params die "Invalid PID $const{pid}\n" if not $const{pid} =~ /^[0-9]+$/; #Various lines of code removed print $const{pidwithzeros}, "\n";