HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/libfinance-quote-perl/examples/stockdump.pl
#!/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);