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' ];
In reply to Re^2: Splitting a string in Perl
by kyle
in thread Splitting a string in Perl
by gzayzay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |