Skip to content

Instantly share code, notes, and snippets.

@jeff

jeff/jason.pl Secret

Created April 7, 2021 20:15
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 jeff/a4fd184305f0a7870258040e3e3ce702 to your computer and use it in GitHub Desktop.
Save jeff/a4fd184305f0a7870258040e3e3ce702 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use JSON::XS;
my $total = [];
my @ready = grep {$_ == 1} @$total;
my @desk = ();
my $resp = {total => scalar(@$total), ready => scalar(@ready), behind_desk => scalar(@desk)};
print encode_json($resp), "\n";
$ perlbrew exec ./jason.pl
perl-5.32.1
==========
{"ready":"0","behind_desk":"0","total":0}
perl-5.28.3
==========
{"total":0,"behind_desk":"0","ready":"0"}
perl-5.26.3
==========
{"ready":0,"total":0,"behind_desk":0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment