Next | Program Repair Shop | 293 |
Here's the code I showed in the article:
@physical_lines = split /\n/, $header; @logical_lines = (); for $current_line (@physical_lines) { if ($current_line =~ /^\s/) { $previous_line .= $current_line; # Rejoin } else { push @logical_lines, $previous_line if defined $previous_line; $previous_line = $current_line; }
push @logical_lines, $previous_line;
We split the header into physical lines
Then rejoin them into logical lines
Next | Copyright © 2002 M. J. Dominus |