NAME

Finance::Currency::Convert::BChile - Currency conversion module between Chilean Pesos (CLP) and USA Dollars (USD).

VERSION

Version 0.01

SYNOPSIS

Currency conversion module between Chilean Pesos (CLP) and USA Dollars (USD). The conversion rate is obtained from the official source in Chile: the central bank "Banco Central de Chile", from their webpage http://www.bcentral.cl

use Finance::Currency::Convert::BChile;

my $conversor = Finance::Currency::Convert::BChile->new();
$conversor->update;
print $conversor->CLP2USD(20170);

FUNCTIONS

new

Creates a new Finance::Currency::Convert::BChile object. Initializes the web robot. You can pass a user agent string as a parameter.

update

Obtains the data from bcentral page. You can pass a fake value as a parameter. In this case there's no update from bcentral site.

date

Return the date obtained from Banco Central's site. There's no formatting at all.

dollarValue

Return the value of 1 dollar in CLP. There's no formatting.

rate

Return the rate of transforming CLP in USD. If there's no value data, return -1

CLP2USD

Convert the amount received as parameter (CLP) to USD, rounded at two decimals. Returns -1 on error.

USD2CLP

Convert the amount received as parameter (USD) to CLP, rounded as integer (no decimals). Returns -1 on error.

AUTHOR

Hugo Salgado, <hsalgado at vulcano.cl>

BUGS

Please report any bugs or feature requests to bug-finance-currency-convert-bchile at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Finance-Currency-Convert-BChile. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Finance::Currency::Convert::BChile

You can also look for information at:

SEE ALSO

HTML::TokeParser
LWP::UserAgent

TERMS OF USE

The data obtained from bcentral site is under this policy: http://www.bcentral.cl/sitio/condiciones-uso.htm

No liability is accepted by the author for abuse or miuse of the software herein. Use of this software is only permitted under the terms stipulated by bcentral.cl.

ACKNOWLEDGEMENTS

This module was built for NIC Chile (http://www.nic.cl), who granted its liberation as free software.

COPYRIGHT & LICENSE

Copyright 2007 Hugo Salgado, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.