#
# Locale::Currency - ISO three letter codes for currency identification
# (ISO 4217)
#
# $Id: Currency.pm,v 2.2 2002/07/10 16:33:27 neilb Exp $
#
use strict;
require 5.002;
require Exporter;
#-----------------------------------------------------------------------
# Public Global Variables
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
# Private Global Variables
#-----------------------------------------------------------------------
my %CODES = ();
my %CURRENCIES = ();
#=======================================================================
#
# code2currency( CODE )
#
#=======================================================================
sub code2currency
{
my $code = shift;
return undef unless defined $code;
{
}
else
{
#---------------------------------------------------------------
# no such currency code!
#---------------------------------------------------------------
return undef;
}
}
#=======================================================================
#
# currency2code ( CURRENCY )
#
#=======================================================================
sub currency2code
{
my $curr = shift;
return undef unless defined $curr;
if (exists $CURRENCIES{$curr})
{
return $CURRENCIES{$curr};
}
else
{
#---------------------------------------------------------------
# no such currency!
#---------------------------------------------------------------
return undef;
}
}
#=======================================================================
#
# all_currency_codes()
#
#=======================================================================
{
return keys %CODES;
}
#=======================================================================
#
# all_currency_names()
#
#=======================================================================
{
return values %CODES;
}
#=======================================================================
# initialisation code - stuff the DATA into the CODES hash
#=======================================================================
{
my $code;
my $currency;
local $_;
while (<DATA>)
{
next unless /\S/;
chop;
}
close(DATA);
}
1;