Created
March 21, 2012 22:08
-
-
Save dex4er/2153696 to your computer and use it in GitHub Desktop.
Test
This file contains 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
#!/usr/bin/env perl |
This file contains 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
#!/usr/bin/env perl | |
use 5.10.0; | |
my $n = 42; | |
given (eval $ARGV[0]) { | |
when (eval $ARGV[1]) { | |
say "MATCH!"; | |
} | |
when (sub { $_->value eq "x" }) { | |
} | |
default { | |
say "NOPE"; | |
} | |
}; | |
package My; | |
use YAML::XS; | |
use overload | |
'~~' => sub { say Dump @_; return '' }, | |
'""' => sub { __PACKAGE__ }, | |
fallback => 1; | |
sub new { bless {} => shift }; | |
sub value { 42 }; |
This file contains 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
#!/usr/bin/env perl | |
use 5.10.0; | |
given (eval $ARGV[0]) { | |
when (eval $ARGV[1]) { | |
say "MATCH!"; | |
} | |
default { | |
say "NOPE"; | |
} | |
}; | |
package My; | |
use YAML::XS; | |
use overload | |
'~~' => sub { say Dump @_; return '' }, | |
'""' => sub { __PACKAGE__ }, | |
fallback => 1; | |
sub new { bless {} => shift }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment