File: stockdump.pl

package info (click to toggle)
libfinance-quote-perl 1.65-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,268 kB
  • sloc: perl: 10,057; makefile: 2
file content (26 lines) | stat: -rwxr-xr-x 500 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl -w
use strict;
use lib '../lib';
use Finance::Quote;
use Data::Dumper;
use Getopt::Std;

# A very very simple script.  Takes a source and a symbol, looks it up,
# and dumps it to STDOUT.  Useful for debugging.

my %options = ('c' => '');

getopts('c:',\%options);

die "Usage: $0 [-c currency] source symbol\n" unless (defined $ARGV[1]);

my $q = Finance::Quote->new;

if ($options{'c'}) {
	$q->set_currency($options{'c'});
}

my %quotes = $q->fetch(@ARGV);

print Dumper(\%quotes);