[thelist] Perl string help

Struan Donald struan at exo.org.uk
Wed Feb 14 08:52:14 CST 2007


* at 13/02 22:37 -0700 Amy Johnson said:
> Thank you!  This helped tremendously!

Glad it helped.

FWIW Bill's regex solution is quite likely quicker and it's certainly
a more Perlish solution. And if you can use the Text::Wrap solution
then that's even better as Text::Wrap is much more likely to handle
edge cases.

cheers

Struan

> > I am not a Perl guru but...
> > 
> > assuming $text contains the text you want to split up then 
> > the following should work. At the end you'll have an array 
> > (@pieces) which contains all the pieces.
> > 
> > my $piece_length = 250;
> > 
> > my @pieces;
> > my $start = 0;

<snip>



More information about the thelist mailing list