in reply to Re: Splitting a string in Perl
in thread Splitting a string in Perl

Good catch! To make a split solution work here, you'd need the optional third argument.

use Data::Dumper; my $in = '0000 21 20 20 20 20 20 20 20 36 ! 6'; my @out = split /\s{2,}/, $in, 3; print Dumper \@out; __END__ $VAR1 = [ '0000', '21 20 20 20 20 20 20 20 36', '! 6' ];