in reply to How can i extract a number from an string

my ($number) = $var1 =~ /([0-9]+)/; # Or my $number = substr $var1, 2, 1;