Skip to content

Instantly share code, notes, and snippets.

@bioduds
Created September 22, 2016 12:43
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 bioduds/994ab32212addb2da48de872226786ed to your computer and use it in GitHub Desktop.
Save bioduds/994ab32212addb2da48de872226786ed to your computer and use it in GitHub Desktop.
pm pl files
# 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;
@bioduds
Copy link
Author

bioduds commented Sep 22, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment