in reply to Remove leading spaces (left justify)
$par_indent = 0; # or +ve for first line indenting $line_indent = 5; # char pos baseline. +ve for hang indent $line = <>; ($spaces, $first_line) = $line =~ m/^( *)([^ ].+)/; $chop_chars = length $spaces; print ' ' x $par_indent . $first_line . "\n"; while ($line = <>) { print ' ' x $line_indent . substr $line,$chop_chars }
|
|---|