You can certainly do it in Perl but why bother? Google for 'pretty print C++' to find all sort of ready made solutions. Like http://www.softpanorama.org/Tools/beautifiers.shtml Here is one in C++ ASBeautifier.cpp
Perl has all sorts of great pre rolled libraies with amazing coverage at the CPAN (Comprehensive Perl Archive Nework) http://cpan.org For example there is Text::Wrap but I would go with a C++ pre-coded beutifier unless you want to have a fun and useful Perl project to tool around with. You may like stuff like Inline:CPP which will let you embed C++ into your Perl so you can mix and match.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Text Wrapping
by tachyon
in thread Text Wrapping
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |