Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created June 2, 2012 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/2858778 to your computer and use it in GitHub Desktop.
Save tadzik/2858778 to your computer and use it in GitHub Desktop.
┌─[tadzik@yavin4]─[~]
└─[%]─> cat Foo.pm
class Foo {
method bar {
say "hello, I am Foo";
die "oh noes";
}
}
┌─[tadzik@yavin4]─[~]
└─[%]─> cat dynload.pl
use lib '.';
require 'Foo';
try {
::('Foo').bar;
CATCH {
say "can has exception {$_.perl}"
}
}
┌─[tadzik@yavin4]─[~]
└─[%]─> perl6 dynload.pl
hello, I am Foo
can has exception X::AdHoc.new(payload => "oh noes")
oh noes
in method bar at ./Foo.pm:4
in block <anon> at dynload.pl:7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment