my @list = (1, 2, 3); my $tmpl = '%-3s|%-4s|%-5s'; @list = split/\|/, sprintf $tmpl, @list; $" = '='; print "=@list=\n";