in reply to Can split split against more than one character in a string of the same character?
No need to mess with split when you just want to divide up a string of the same chars:
use strict; use warnings; use Test::More tests => 1; my $in = 'aaaaaaaaa'; my $want = 'aa aa aa aa a'; my $have = join ' ', ($in =~ /a{1,2}/g); is $have, $want;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can split split against more than one character in a string of the same character?
by Don Coyote (Hermit) on Jul 15, 2019 at 22:29 UTC |