Thanks
> How can I insert a newline every nth character?
$string =~ s/(.{$n})/$1\n/g;
--
Tad McClellan SGML consulting
ta...@augustmail.com Perl programming
Fort Worth, Texas
fold or fmt would be better. There is a perl implementation of fold
as a part of the Perl Power Tools bundle, which is available on CPAN.
(search.cpan.org isn't responding at the moment or I'd give you a
direct link.)
Jon
Untested:
perl -i -wle '$\ = \80; print "$_\n" while <>' your_file
Change 80 to 'n'.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
my $n = 30;
substr( $long, $n*$_, 0, "\n") for reverse 1 .. length( $long)/$n;
Anno
Thanks for the replys!
It works like a charm =)
<snip signature>
>
>
> Thanks for the replys!
>
> It works like a charm =)
>
Weren't sure whether to top post or not? You got it right this time, but no
need to quote an entire message plus signature.
Matt