http://qs321.pair.com?node_id=11102899


in reply to Can split split against more than one character in a string of the same character?

Another approach would be to use unpack.

johngg@shiraz:~/perl/Monks$ perl -Mstrict -Mwarnings -E ' my $str = q{aaaaaaaaa}; my @parts = unpack q{(a2)*}, $str; say qq{@parts};' aa aa aa aa a

I hope this is helpful.

Cheers,

JohnGG

  • Comment on Re: Can split split against more than one character in a string of the same character?
  • Download Code

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:35 UTC

    That looks fast!