Skip to content

Instantly share code, notes, and snippets.

Created December 21, 2012 22:33
Show Gist options
  • Save anonymous/4356311 to your computer and use it in GitHub Desktop.
Save anonymous/4356311 to your computer and use it in GitHub Desktop.
Smartmatch and arrayrefs
use strict;
use warnings;
print "ok 1\n" if 2 ~~ (1,2);
print "ok 2\n" if 2 ~~ [1,2];
my $foo = [];
print "ok 3\n" if $foo ~~ (1,$foo);
print "ok 4\n" if $foo ~~ [1,$foo];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment