Skip to content

Instantly share code, notes, and snippets.

@rlb3
Created October 26, 2012 17:50
Show Gist options
  • Select an option

  • Save rlb3/3960230 to your computer and use it in GitHub Desktop.

Select an option

Save rlb3/3960230 to your computer and use it in GitHub Desktop.
wait what?
#!/usr/bin/perl -w
use strict;
use warnings;
{
package DEEP;
sub deeply { "deeply inherited" }
package UNIVERSAL;
our @ISA = qw/DEEP/;
package Foo;
our @ISA = qw//;
}
print "Foo can do deeply\n" if Foo->can('deeply');
print "Foo isa UNIVERSAL\n" if Foo->isa('UNIVERSAL');
print "Foo is, strangely, not DEEP\n" unless Foo->isa('DEEP');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment