use strict; open INPUT, ") { # read a line of input my @contents=split /\s+/; # Split on whitespace print join ":", (pack("A10",$contents[0]), # Name, padded to 10 width pack("A5",$contents[1]), # version, padded to 5 width "\n"); } __END__ Nameone :100 : Nametwo :110 : Namethree :120 :