From doomvox at gmail.com Wed Nov 2 14:46:36 2022 From: doomvox at gmail.com (Joseph Brenner) Date: Wed, 2 Nov 2022 14:46:36 -0700 Subject: [sf-perl] The SF Perl Raku Study Group, 10/06 at 1pm PDT Message-ID: "The FSF software distribution has added a third tape. The old Compiler tape has been split into a Languages and a Utilities tape. Some software has also moved from the Emacs tape to the other two tapes ..." --"GNU's Bulletin" (1992) The Raku Study Group November 6, 2022 1pm in California, 9pm in the UK (Note: here in the US we will be celebrating what may be the last ever "fall back", so that 1pm is an hour later than the previous day's 1pm) Zoom meeting link: https://us02web.zoom.us/j/87472315832?pwd=K2wwcktDbGVnQTNUMnF5SnNZbWN5QT09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/san-francisco-perl/events/289504476/ An informal meeting: drop by when you can, show us what you've got, ask and answer questions, or just listen and lurk. Perl and programming in general are fair game, along with Raku, From doomvox at gmail.com Thu Nov 17 16:45:45 2022 From: doomvox at gmail.com (Joseph Brenner) Date: Thu, 17 Nov 2022 16:45:45 -0800 Subject: [sf-perl] The SF Perl Raku Study Group, 11/20 at 1pm PDT Message-ID: "They're all like 20-year old single Silicon Valley men, of course they're afraid of commitment." -- Matt S. Trout, on the pletheroa of Javascript libraries "ES6: Almost an Acceptable Perl5?" (2017) The Raku Study Group: An informal meeting: drop by when you can, show us what you've got, ask and answer questions, or just listen and lurk. Along with Raku, Perl and programming in general are fair game. November 20, 2022 1pm in California, 9pm in the UK Zoom meeting link: https://us02web.zoom.us/j/82235449629?pwd=ODFGMDlxRHlYSzZwOTJUcE9GNnVYUT09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/san-francisco-perl/events/289822586/ From wjm1 at caa.columbia.edu Sun Nov 20 07:37:43 2022 From: wjm1 at caa.columbia.edu (William Michels) Date: Sun, 20 Nov 2022 07:37:43 -0800 Subject: [sf-perl] REST-API fail (POST request). Message-ID: Hello, I'm trying to get the example Perl5 code from the bottom of this REST-API page to work: https://rest.ensembl.org/documentation/info/archive_id_post I can get the example curl, wget, and R code to work from the same page, so I know the server (https://rest.ensembl.org) is up and running. Below is the code, cut-and-pasted. I had to install the JSON module. All I get back is the string "Failed!" while curl, wget, and R all return actual data: use strict; use warnings; use HTTP::Tiny; my $http = HTTP::Tiny->new(); my $server = 'https://rest.ensembl.org'; my $ext = '/archive/id'; my $response = $http->request('POST', $server.$ext, { headers => { 'Content-type' => 'application/json', 'Accept' => 'application/json' }, content => '{ "id" : ["ENSG00000157764", "ENSG00000248378"] }' }); die "Failed!\n" unless $response->{success}; use JSON; use Data::Dumper; if(length $response->{content}) { my $hash = decode_json($response->{content}); local $Data::Dumper::Terse = 1; local $Data::Dumper::Indent = 1; print Dumper $hash; print "\n"; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From collinseaton at gmail.com Sun Nov 20 09:47:51 2022 From: collinseaton at gmail.com (Collin Seaton) Date: Sun, 20 Nov 2022 09:47:51 -0800 Subject: [sf-perl] REST-API fail (POST request). In-Reply-To: References: Message-ID: Hi William, You can check your $response for more details on the failure. Specifically: die "Failed: ", $response->{content}, "\n" unless $response->{success}; This is a guess, based on past work with Perl and web APIs, but you probably need to install some modules to support the https protocol. From the HTTP::Tiny docs, you'll need IO::Socket::SSL and Net::SSLeay. https://metacpan.org/pod/HTTP::Tiny#SSL-SUPPORT -collin On Sun, Nov 20, 2022 at 7:38 AM William Michels wrote: > Hello, > > I'm trying to get the example Perl5 code from the bottom of this REST-API > page to work: > > https://rest.ensembl.org/documentation/info/archive_id_post > > I can get the example curl, wget, and R code to work from the same page, > so I know the server (https://rest.ensembl.org) is up and running. Below > is the code, cut-and-pasted. I had to install the JSON module. All I get > back is the string "Failed!" while curl, wget, and R all return actual > data: > > > use strict; > use warnings; > > use HTTP::Tiny; > > my $http = HTTP::Tiny->new(); > > my $server = 'https://rest.ensembl.org'; > my $ext = '/archive/id'; > my $response = $http->request('POST', $server.$ext, { > headers => { > 'Content-type' => 'application/json', > 'Accept' => 'application/json' > }, > content => '{ "id" : ["ENSG00000157764", "ENSG00000248378"] }' > }); > > die "Failed!\n" unless $response->{success}; > > > use JSON; > use Data::Dumper; > if(length $response->{content}) { > my $hash = decode_json($response->{content}); > local $Data::Dumper::Terse = 1; > local $Data::Dumper::Indent = 1; > print Dumper $hash; > print "\n"; > } > > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > https://mail.pm.org/mailman/listinfo/sanfrancisco-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From doomvox at gmail.com Sun Nov 20 12:35:29 2022 From: doomvox at gmail.com (Joseph Brenner) Date: Sun, 20 Nov 2022 12:35:29 -0800 Subject: [sf-perl] REST-API fail (POST request). In-Reply-To: References: Message-ID: Yes, for what it's worth, that code example works for me: perl /home/doom/End/Cave/RakuStudy/Wall/raku-study/bin/2022nov20/rest_api_demo.pl [ { 'possible_replacement' => [], 'assembly' => 'GRCh38', 'latest' => 'ENSG00000157764.14', 'id' => 'ENSG00000157764', 'release' => '108', 'type' => 'Gene', 'is_current' => '1', 'version' => 14, 'peptide' => undef }, { 'assembly' => 'GRCh38', 'possible_replacement' => [], 'release' => '108', 'latest' => 'ENSG00000248378.1', 'id' => 'ENSG00000248378', 'version' => 1, 'peptide' => undef, 'type' => 'Gene', 'is_current' => '1' } ] I might suggest playing with "cpanm", aka "cpanminus"-- it's a good, no-brainer way of installing perl modules for your own use without fussing with sysadmin tasks too much. https://metacpan.org/pod/App::cpanminus On 11/20/22, Collin Seaton wrote: > Hi William, > You can check your $response for more details on the failure. Specifically: > > die "Failed: ", $response->{content}, "\n" unless $response->{success}; > > This is a guess, based on past work with Perl and web APIs, but you > probably need to install some modules to support the https protocol. From > the HTTP::Tiny docs, you'll need IO::Socket::SSL and Net::SSLeay. > https://metacpan.org/pod/HTTP::Tiny#SSL-SUPPORT > > -collin > > On Sun, Nov 20, 2022 at 7:38 AM William Michels > wrote: > >> Hello, >> >> I'm trying to get the example Perl5 code from the bottom of this REST-API >> page to work: >> >> https://rest.ensembl.org/documentation/info/archive_id_post >> >> I can get the example curl, wget, and R code to work from the same page, >> so I know the server (https://rest.ensembl.org) is up and running. Below >> is the code, cut-and-pasted. I had to install the JSON module. All I get >> back is the string "Failed!" while curl, wget, and R all return actual >> data: >> >> >> use strict; >> use warnings; >> >> use HTTP::Tiny; >> >> my $http = HTTP::Tiny->new(); >> >> my $server = 'https://rest.ensembl.org'; >> my $ext = '/archive/id'; >> my $response = $http->request('POST', $server.$ext, { >> headers => { >> 'Content-type' => 'application/json', >> 'Accept' => 'application/json' >> }, >> content => '{ "id" : ["ENSG00000157764", "ENSG00000248378"] }' >> }); >> >> die "Failed!\n" unless $response->{success}; >> >> >> use JSON; >> use Data::Dumper; >> if(length $response->{content}) { >> my $hash = decode_json($response->{content}); >> local $Data::Dumper::Terse = 1; >> local $Data::Dumper::Indent = 1; >> print Dumper $hash; >> print "\n"; >> } >> >> >> >> _______________________________________________ >> SanFrancisco-pm mailing list >> SanFrancisco-pm at pm.org >> https://mail.pm.org/mailman/listinfo/sanfrancisco-pm >> > From wjm1 at caa.columbia.edu Sun Nov 20 13:02:41 2022 From: wjm1 at caa.columbia.edu (William Michels) Date: Sun, 20 Nov 2022 13:02:41 -0800 Subject: [sf-perl] REST-API fail (POST request). In-Reply-To: References: Message-ID: Thank you so much Collin for the quick response! Well everything seems to be working now. I installed IO::Socket::SSL and Net::SSLeay as you suggested, and edited the `die` line according to your specification. Here's the response: [ { 'is_current' => '1', 'version' => 14, 'release' => '108', 'type' => 'Gene', 'latest' => 'ENSG00000157764.14', 'possible_replacement' => [], 'peptide' => undef, 'id' => 'ENSG00000157764', 'assembly' => 'GRCh38' }, { 'id' => 'ENSG00000248378', 'assembly' => 'GRCh38', 'latest' => 'ENSG00000248378.1', 'possible_replacement' => [], 'peptide' => undef, 'release' => '108', 'type' => 'Gene', 'is_current' => '1', 'version' => 1 } ] One slight weirdness: if I edit out both lines `use IO::Socket::SSL` and `use Net::SSLeay` everything still works. I guess there could be multiple explanations, the two primary explanations being that 1) something changed on the server and/or 2) something changed with my Perl5 ecosystem. Anyway, happy it's working. Best Regards, Bill. On Sun, Nov 20, 2022 at 9:48 AM Collin Seaton wrote: > Hi William, > You can check your $response for more details on the failure. Specifically: > > die "Failed: ", $response->{content}, "\n" unless $response->{success}; > > This is a guess, based on past work with Perl and web APIs, but you > probably need to install some modules to support the https protocol. From > the HTTP::Tiny docs, you'll need IO::Socket::SSL and Net::SSLeay. > https://metacpan.org/pod/HTTP::Tiny#SSL-SUPPORT > > -collin > > On Sun, Nov 20, 2022 at 7:38 AM William Michels > wrote: > >> Hello, >> >> I'm trying to get the example Perl5 code from the bottom of this REST-API >> page to work: >> >> https://rest.ensembl.org/documentation/info/archive_id_post >> >> I can get the example curl, wget, and R code to work from the same page, >> so I know the server (https://rest.ensembl.org) is up and running. Below >> is the code, cut-and-pasted. I had to install the JSON module. All I get >> back is the string "Failed!" while curl, wget, and R all return actual >> data: >> >> >> use strict; >> use warnings; >> >> use HTTP::Tiny; >> >> my $http = HTTP::Tiny->new(); >> >> my $server = 'https://rest.ensembl.org'; >> my $ext = '/archive/id'; >> my $response = $http->request('POST', $server.$ext, { >> headers => { >> 'Content-type' => 'application/json', >> 'Accept' => 'application/json' >> }, >> content => '{ "id" : ["ENSG00000157764", "ENSG00000248378"] }' >> }); >> >> die "Failed!\n" unless $response->{success}; >> >> >> use JSON; >> use Data::Dumper; >> if(length $response->{content}) { >> my $hash = decode_json($response->{content}); >> local $Data::Dumper::Terse = 1; >> local $Data::Dumper::Indent = 1; >> print Dumper $hash; >> print "\n"; >> } >> >> >> >> _______________________________________________ >> SanFrancisco-pm mailing list >> SanFrancisco-pm at pm.org >> https://mail.pm.org/mailman/listinfo/sanfrancisco-pm >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wjm1 at caa.columbia.edu Tue Nov 22 10:57:17 2022 From: wjm1 at caa.columbia.edu (William Michels) Date: Tue, 22 Nov 2022 10:57:17 -0800 Subject: [sf-perl] REST-API fail (POST request). In-Reply-To: References: Message-ID: Thanks Joe! As I mentioned in an earlier response, everything started to work after I installed IO::Socket::SSL and Net::SSLeay. FWIW, here's my Perl5 info, generally installed with Macports (running on an ancient MacOS = 10.11.6 El Capitan): user at mbook:~$ which perl /opt/local/bin/perl user at mbook:~$ perl --version This is perl 5, version 34, subversion 1 (v5.34.1) built for darwin-thread-multi-2level Copyright 1987-2022, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. user at mbook:~$ On Sun, Nov 20, 2022 at 12:35 PM Joseph Brenner wrote: > Yes, for what it's worth, that code example works for me: > > perl /home/doom/End/Cave/RakuStudy/Wall/raku-study/bin/2022nov20/ > rest_api_demo.pl > [ > { > 'possible_replacement' => [], > 'assembly' => 'GRCh38', > 'latest' => 'ENSG00000157764.14', > 'id' => 'ENSG00000157764', > 'release' => '108', > 'type' => 'Gene', > 'is_current' => '1', > 'version' => 14, > 'peptide' => undef > }, > { > 'assembly' => 'GRCh38', > 'possible_replacement' => [], > 'release' => '108', > 'latest' => 'ENSG00000248378.1', > 'id' => 'ENSG00000248378', > 'version' => 1, > 'peptide' => undef, > 'type' => 'Gene', > 'is_current' => '1' > } > ] > > > I might suggest playing with "cpanm", aka "cpanminus"-- it's a good, > no-brainer way of installing perl modules for your own use without > fussing with sysadmin tasks too much. > > https://metacpan.org/pod/App::cpanminus > > > > On 11/20/22, Collin Seaton wrote: > > Hi William, > > You can check your $response for more details on the failure. > Specifically: > > > > die "Failed: ", $response->{content}, "\n" unless $response->{success}; > > > > This is a guess, based on past work with Perl and web APIs, but you > > probably need to install some modules to support the https protocol. From > > the HTTP::Tiny docs, you'll need IO::Socket::SSL and Net::SSLeay. > > https://metacpan.org/pod/HTTP::Tiny#SSL-SUPPORT > > > > -collin > > > > On Sun, Nov 20, 2022 at 7:38 AM William Michels > > wrote: > > > >> Hello, > >> > >> I'm trying to get the example Perl5 code from the bottom of this > REST-API > >> page to work: > >> > >> https://rest.ensembl.org/documentation/info/archive_id_post > >> > >> I can get the example curl, wget, and R code to work from the same page, > >> so I know the server (https://rest.ensembl.org) is up and running. > Below > >> is the code, cut-and-pasted. I had to install the JSON module. All I get > >> back is the string "Failed!" while curl, wget, and R all return actual > >> data: > >> > >> > >> use strict; > >> use warnings; > >> > >> use HTTP::Tiny; > >> > >> my $http = HTTP::Tiny->new(); > >> > >> my $server = 'https://rest.ensembl.org'; > >> my $ext = '/archive/id'; > >> my $response = $http->request('POST', $server.$ext, { > >> headers => { > >> 'Content-type' => 'application/json', > >> 'Accept' => 'application/json' > >> }, > >> content => '{ "id" : ["ENSG00000157764", "ENSG00000248378"] }' > >> }); > >> > >> die "Failed!\n" unless $response->{success}; > >> > >> > >> use JSON; > >> use Data::Dumper; > >> if(length $response->{content}) { > >> my $hash = decode_json($response->{content}); > >> local $Data::Dumper::Terse = 1; > >> local $Data::Dumper::Indent = 1; > >> print Dumper $hash; > >> print "\n"; > >> } > >> > >> > >> > >> _______________________________________________ > >> SanFrancisco-pm mailing list > >> SanFrancisco-pm at pm.org > >> https://mail.pm.org/mailman/listinfo/sanfrancisco-pm > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From doomvox at gmail.com Mon Nov 28 21:29:54 2022 From: doomvox at gmail.com (Joseph Brenner) Date: Mon, 28 Nov 2022 21:29:54 -0800 Subject: [sf-perl] The SF Perl Raku Study Group (postponed) Message-ID: On the next few Sundays, I've got some schedule conflicts, so I've got to skip holding the Raku Study Group when we usually would on December 4th. Instead the next meeting will be on December 18th, and after that we'll most likely do one on New Years Day itself, January 1st, 2023. From deloreanx at yahoo.co.uk Mon Nov 28 21:31:15 2022 From: deloreanx at yahoo.co.uk (deloreanx at yahoo.co.uk) Date: Tue, 29 Nov 2022 05:31:15 +0000 (UTC) Subject: [sf-perl] The SF Perl Raku Study Group (postponed) In-Reply-To: References: Message-ID: <121122130.3250331.1669699875800@mail.yahoo.com> Sounds good to me. Sent from Yahoo Mail for iPhone On Monday, November 28, 2022, 9:30 PM, Joseph Brenner wrote: On the next few Sundays, I've got some schedule conflicts, so I've got to skip holding the Raku Study Group when we usually would on December 4th. Instead the next meeting will be on December 18th, and after that we'll most likely do one on New Years Day itself, January 1st, 2023. _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org https://mail.pm.org/mailman/listinfo/sanfrancisco-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: