in reply to Re: Break sentence into two part
in thread Break sentence into two part
Yes, that’s how I would approach the problem. But there’s no need to populate new arrays using push, etc.: just use array slices directly:
my $first_half = join(' ', @words[0 .. $midpoint]); my $second_half = join(' ', @words[$midpoint + 1 .. $#words ]);
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|