in reply to Using a regex to extract a version from a Un*x path
Don't use a regex, use a function.
my $version = get_version( $path ); sub get_version { # complicated logic here my($p) = @_; my $v ; $v = get_version_home_csv($p); return $v if $v; $v = get_version_custom1($p); return $v if $v; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using a regex to extract a version from a Un*x path
by Marshall (Canon) on Mar 18, 2010 at 08:57 UTC | |
by Anonymous Monk on Mar 18, 2010 at 13:53 UTC | |
|
Re^2: Using a regex to extract a version from a Un*x path
by gcmandrake (Novice) on Mar 18, 2010 at 16:05 UTC |