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/currency-lookup.pl
#!/usr/bin/perl -w
use strict;
use lib '../lib';
use Finance::Quote;

# This script demonstrates how currencies can be converted using
# Finance::Quote.

# Example usage:   currency-lookup.pl USD AUD
# (Converts from US Dollars to Australian Dollars)

die "Usage: $0 FROM TO\n" unless defined($ARGV[1]);

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

my $exchange_rate = $q->currency($ARGV[0],$ARGV[1]);

die "Urgh!  Nothing back\n" unless $exchange_rate;

print $ARGV[0]."->".$ARGV[1]." = ".$exchange_rate."\n";