while (){ chomp($_); push(@splittedline,$+ ) while $_ =~m{ ([^\S\s*:\S\s*]*) }gx; } # Sorry iam poor in regular expressions # i tried several regular expressions, above gives error # and doesnt work properly # finally @splitted line should contain key value pairs # One might wonder what above is, my requirement is to # read the TNG scheduler output containing Jobs info # and nicely format into text document