-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhello
More file actions
35 lines (25 loc) · 722 Bytes
/
hello
File metadata and controls
35 lines (25 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use v5.10;
use Data::Dumper;
use HTTP::Tiny;
sub handler {
my $event = shift;
# this logs to the Cloudwatch log of the Lambda function
say STDERR Dumper($event);
say STDERR Dumper(\@INC, \%ENV);
# this is the stuff that gets returned to the invoker
return 40+2 . " is the answer. Running Perl $^V from $^X";
}
sub error {
die "I've died";
}
sub https_request {
my $ua = HTTP::Tiny->new;
my $response = $ua->get('https://metacpan.org/recent');
die $response->{ content } if (not $response->{ success });
my ($results) = ($response->{ content } =~ m/(\d+,\d+)/);
return "There are currently $results packages on CPAN";
}
sub ls_opt {
print STDERR `ls -la /opt/layer1-lib/lib/perl5`;
}
1;