Created
September 22, 2016 12:43
-
-
Save bioduds/994ab32212addb2da48de872226786ed to your computer and use it in GitHub Desktop.
pm pl files
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
# Eduardo Capanema - PM FILE | |
unit module ef8a4da32a; | |
use JSON::Class; | |
my &infix:<++> = &infix:<~>; | |
subset IdentStr of Str where /^<.ident>$/; | |
subset Gênero of Str where * eq "Homem"|"Mulher"; | |
class Técnico does JSON::Class { | |
my $.identidade = "Técnico"; | |
has $.nome; | |
has Gênero $.gênero; | |
has Int $.idade; | |
has Rat $.rate; | |
} | |
sub ef8a4da32a-get-json is export { | |
my @técnicos = Técnico.new( nome => "Marcelo Oliveira", gênero => "Homem", idade => 54, rate => 3.88 ), | |
Técnico.new( nome => "Levir Culpi", gênero => "Homem", idade => 52, rate => 4.12 ); | |
return $@técnicos[0].to-json(); | |
} | |
# Eduardo Capanema - PL FILE | |
#!/usr/bin/env perl6 | |
use v6; | |
use lib 'lib'; | |
use ef8a4da32a; | |
say ef8a4da32a-get-json; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok, so thing is. When I run this, it works fine. Nevertheless, if I call it to get the stdout of it from another program, it only works if I get the PM code and put in the pl file. I can't understand the reason. I know that it is getting called using /bin/sh -c perl get_data.pl