Actually, I'm pretty sure that it is working. It's just that you are discarding your changes by sometimes using $new, sometimes using $aphor. Specifically:
$new= join "\n\t", @sect; &shortenlines; # uses $amphor for input instead of $new.
You'll gain so much by using proper parameters and return values. It is much harder to make a good program that uses globals and exit() all over the place (but not impossible, says Wassercrats).
In reply to Re: unexpected behavior with split
by ikegami
in thread unexpected behavior with split
by ww
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |