#!/usr/bin/perl use Finance::Quote; use Carp; # This should give you more info if it couldn't read the file open SLIST, <, "/scripts/test.txt" or croak "Cannot open file - $!\n"; @stocks = ; close (SLIST); # This will confirm that the stocks read in from the file are # what you expect print "Checking stocks: "; for my $stock (@stocks) { print "$stock "; } print "\n"; # the following code (uncommented) worked fine for me. # It got google's stock quote correctly #@stocks = ("GOOG"); $q = Finance::Quote->new; $cc = 'usa'; $symb = 'WTVN.PK'; # What is this used for? If not needed, good to delete it %myhash = $q->fetch($cc,@stocks); foreach $ans (@stocks){ print $ans ."-". $myhash{$ans,'price'}; }