Hi All, I should tell you I'm a real newbie. Only just half way through my first book. But I figured I would try a project to get me going - doing rather than just reading. I am using an API to get data returned.
This returns the following#!/usr/bin/perl use warnings; use strict; use WebService::Tesco::API; # Code to log in removed my $code = $tesco->product_search({ searchtext => $pn, extendedinfo => + 'N' });
{ "StatusCode": 0, "StatusInfo": "Command Processed OK", "PageNumber": 0, "TotalPageCount": 1, "TotalProductCount": 1, "PageProductCount": 1, "Products": [ { "BaseProductId": "50043662", "EANBarcode": "5000175411118", "CheaperAlternativeProductId": "", "HealthierAlternativeProductId": "", "ImagePath": "http://img.tesco.com/Groceries/pi/118/5000175411118/IDSh +ot_90x90.jpg", "MaximumPurchaseQuantity": 99, "Name": "Oxo 12 Chicken Stock Cubes 71G", "OfferPromotion": "Price Drop Was £1.13 Now £1.00 ", "OfferValidity": "valid from 30/7/2012 until 9/9/2012", "OfferLabelImagePath": "http://www.tesco.com/Groceries/UIAssets/I/Site +s/Retail/Superstore/Online/Product/pos/save.png", "Price": 1, "PriceDescription": "£1.41 each", "ProductId": "254881114", "ProductType": "QuantityOnlyProduct", "UnitPrice": 1.41, "UnitType": "100g" } ] }
I am looking to create a variable that holds the ProductId "254881114" As I need this number to make my next URL. Any help would be gratefully received. Best wishes. James.
In reply to Data from a Hash/Array by foggy3657
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |