On 2012-04-16 07:58, Shekar wrote: > next if (/^\s$/); You probably meant: next if /^\s*$/; # skip blank lines -- Ruud