Hello Monks!
I am using PUBCHEM's PUG REST service to download properties of a specific chemical compound. I want to give STDIN input of the chemical compound in the form of a SMILES string (it's a format to represent a chemical compound, like a molecular formula). The PUG REST URL format looks like this:
http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/CCC/property/MolecularFormula,MolecularWeight,TPSA/CSV/
http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/<smiles string>/property/<properties of interest>/<output file format>/Now, how do I STDIN my smiles string in the above format of URL? I've tried some little tricks like this:
and warning was: Use of uninitialized value $finalurl in print at test_lwp.pl line 12. Thanks in advance :)#!/usr/bin/perl use LWP::Simple; my $smiles = <STDIN>; my $url = 'http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/'; + my $finalurl = get "$url$smiles/property/MolecularFormula,MolecularWei +ght,TPSA/CSV/"; print $finalurl;
In reply to How to use STDIN in between a URL? by piscean
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |