# $filename declared elsewhere $filename =~ /\A [^-]+ # Read until the first '-' ([\d\.]+) # Grab a series digits and '.' chars /x; my $version = $1;