#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
say "This is perl $^V";
sub awesome {
say "yay, this works";
}
}
# this works
'Input'->awesome;
# the "open" is parsed, but not actually executed
sub red_herring {
open Input, "<&", \*STDIN or die $!;
}
END
say "eval failed: $@" if $@;
# this will die
'Input'->awesome;
};
say "Caught: $@" if $@;
IyEvdXNyL2Jpbi9wZXJsCnVzZSBzdHJpY3Q7CnVzZSB3YXJuaW5nczsKdXNlIGZlYXR1cmUgJ3NheSc7CgpzYXkgIlRoaXMgaXMgcGVybCAkXlYiOwoKcGFja2FnZSBJbnB1dCB7CglzdWIgYXdlc29tZSB7CgkJc2F5ICJ5YXksIHRoaXMgd29ya3MiOwoJfQp9CgojIHRoaXMgd29ya3MKJ0lucHV0Jy0+YXdlc29tZTsKCiMgdGhlICJvcGVuIiBpcyBwYXJzZWQsIGJ1dCBub3QgYWN0dWFsbHkgZXhlY3V0ZWQKZXZhbCA8PCdFTkQnOwoJc3ViIHJlZF9oZXJyaW5nIHsKCQlvcGVuIElucHV0LCAiPCYiLCBcKlNURElOIG9yIGRpZSAkITsKCX0KRU5ECnNheSAiZXZhbCBmYWlsZWQ6ICRAIiBpZiAkQDsKCiMgdGhpcyB3aWxsIGRpZQpldmFsIHsKCSdJbnB1dCctPmF3ZXNvbWU7Cn07CnNheSAiQ2F1Z2h0OiAkQCIgaWYgJEA7