sub compare_versions { my( $left, $right )= @_; for( $left, $right ) { s/(\d+)/pack "N",$1/ge; } return $left cmp $right; }