Created
October 23, 2018 01:35
-
-
Save S2/8a5b5c770521ce763b8fa0f97fe69414 to your computer and use it in GitHub Desktop.
Webperl.js
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<meta name="viewport" content="width=device-width"> | |
</head> | |
<body> | |
<button id="my_button" class="btn btn-primary">決定</button> | |
<script src="webperl.js"> | |
</script> | |
<script type="text/perl"> | |
use 5.18.0; | |
use strict; | |
use warnings; | |
use utf8; | |
package Hoge{ | |
sub new { | |
my $class = shift; | |
my $args = ref $_[0] ? $_[0] : +{@_}; | |
bless $args, $class; | |
} | |
sub method_a{ | |
say "method_a" | |
} | |
} | |
package Fuga{ | |
use 5.18.0; | |
use strict; | |
use warnings; | |
use utf8; | |
sub new { | |
my $class = shift; | |
my $args = ref $_[0] ? $_[0] : +{@_}; | |
bless $args, $class; | |
} | |
sub method_b{ | |
say "method_b" | |
} | |
} | |
@{Piyo::ISA} = qw/Hoge Fuga/; | |
my $piyo = new Piyo; | |
$piyo->method_a; | |
$piyo->method_b; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment