I'd use a global regex to extract just the digits directly into an array:
use warnings; use strict; my $string = 'MD:Z:4C3C7C0T2^T9C44'; my @nums = $string =~ /\d+/g; print "$_\n" for @nums;
Output:
4 3 7 0 2 9 44
In reply to Re: Leading empty array elements after splitting
by stevieb
in thread Leading empty array elements after splitting
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |