- or download this
my $x = 'abc12345';
my ($y) = $x =~ /(\d+)$/;
my $length = length($y);
- or download this
my $x = 'abc12345';
my $length = length ($x =~ /(\d+)$/);
# returns 1, the length of the number in the number of elements
- or download this
my $x = 'abc12345';
my $length = map { length } ($x =~ /(\d+)$/);
- or download this
my $x = 'abc12345';
my $length = map { length } ($x =~ /(\d+)$/)[0];
- or download this
my $x = 'abc12345';
my $length = length (($x =~ /(\d+)$/)[0]);
# returns 5