There is a CPAN module for everything...
use Sort::Versions; my $min = '2.0.0.0'; my $max = '3.0.0.0'; my @list = qw( 1.0.0.0 1.1.10.1 2.0.0.0 2.1.0.0 10.6.1.0 ); for my $entry ( @list ) { next if versioncmp( $entry, $min ) < 0 or versioncmp( $entry, $max ) > 0; print "$entry is between $min and $max\n"; }
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: Version list with min and max
by jasonk
in thread Version list with min and max
by USP45
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |