Skip to content

Instantly share code, notes, and snippets.

@dagolden
Created April 25, 2010 23:24
Show Gist options
  • Save dagolden/378823 to your computer and use it in GitHub Desktop.
Save dagolden/378823 to your computer and use it in GitHub Desktop.
#!/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