in reply to Re: bitcoin price from command line
in thread bitcoin price from command line

Hi first thanks for your time, I used the following code
#!/usr/bin/perl -w use feature 'say'; use Mojo::UserAgent; my $ua = Mojo::UserAgent->new; my $coinbaseURL = 'https://api.coindesk.com/v1/bpi/currentprice/usd.js +on'; my $value = $ua->get( $coinbaseURL )->result->json->{bpi}{USD}{rate}; #say "Bitcoin Price (USD): $value"; print "Content-Type: text/html\n\n"; print "Bitcoin Price (USD): $value";
But I got the following error :
[error] [client 127.0.0.1] IO::Socket::SSL 2.009+ required for TLS sup +port at /home/alexandre/apache/cgi-bin/helloWorld.cgi line 10.
EDIT : After upgrading IO::Socket::SSL it's work fine thanks you guys

Replies are listed 'Best First'.
Re^3: bitcoin price from command line
by marto (Cardinal) on Jan 08, 2019 at 13:07 UTC

    Mojo::UserAgent uses various modules for TLS and so on, if they're available (see Description). Either (ideally) install IO::Socket::SSL, or alternatively set the appropriate environment variable to disable the functionality, the first suggestion is better.