Created
April 25, 2010 23:24
-
-
Save dagolden/378823 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/perl/v5.12.0/bin/perl5.12.0 | |
use 5.12.0; | |
use version qw(is_lax is_strict); | |
for (shift @ARGV) { | |
say "'$_'"; | |
say( is_lax($_) ? "...is a lax version" : "... is not a lax version" ); | |
say( is_strict($_) ? "...is a strict version" : "... is not a strict version"); | |
say( ($_ =~ $version::LAX) ? "...is a lax version" : "... is not a lax version" ); | |
say( ($_ =~ $version::STRICT) ? "...is a strict version" : "... is not a strict version"); | |
say( (defined $_ && $_ =~ qr/ \A $version::LAX \z /x) ? "...is a lax version" : "... is not a lax version" ); | |
say( (defined $_ && $_ =~ qr/ \A $version::STRICT \z /x) ? "...is a strict version" : "... is not a strict version"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment