*alexandre* has asked for the wisdom of the Perl Monks concerning the following question:
and I now want to integrate to my perl scriptecho "1 BTC = $(curl -s https://api.coindesk.com/v1/bpi/currentprice/u +sd.json | grep -o 'rate":"[^"]*' | cut -d\" -f3) USD" 1 BTC
this code print to my browser#!/usr/bin/perl -w use strict; use warnings; use CGI; my $query = CGI->new ; loadPage (); sub loadPage { my $page = ""; $page = $query->param("page"); if ($page eq 'search') { print "Content-Type: text/html\n\n"; print "1 BTC = $(curl -s https://api.coindesk.com/v1/bpi/curre +ntprice/usd.json | grep -o 'rate\":\"[^\"]*' | cut -d\" -f3) USD"; }else { print "Content-Type: text/html\n\n"; print "error"; } }
how guys to integrate properly the command line into a print command instead Thx in advance1 BTC = 33 33curl -s https://api.coindesk.com/v1/bpi/currentprice/usd. +json | grep -o 'rate":"[^"]*' | cut -d" -f3) USD
2019-01-08 Athanasius fixed one code tag
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: bitcoin price from command line
by Corion (Patriarch) on Jan 08, 2019 at 09:21 UTC | |
by *alexandre* (Scribe) on Jan 08, 2019 at 11:38 UTC | |
by Corion (Patriarch) on Jan 08, 2019 at 12:20 UTC | |
|
Re: bitcoin price from command line
by marto (Cardinal) on Jan 08, 2019 at 11:23 UTC | |
by hippo (Archbishop) on Jan 08, 2019 at 12:13 UTC | |
by marto (Cardinal) on Jan 08, 2019 at 12:20 UTC | |
by *alexandre* (Scribe) on Jan 08, 2019 at 12:56 UTC | |
by marto (Cardinal) on Jan 08, 2019 at 13:07 UTC |