in reply to Appending lines starting with white space to the previous line
my $i=0; my $temp = "ARR"; while (<FILE>) { if ($_ !~ /^\s+/) { chomp; $i++; @{$temp{$i}} = ($_); } else { my $temp2 = $_; chomp ($temp2); $temp2 =~ s/^\s+//g; push (@{$temp{$i}},$temp2); } } close (FILE); for $j(0..$i) { print "@{$temp{$j}}"."\n"; }
|
|---|