Skip to Main Content
Wicked Cool Perl Scripts
book

Wicked Cool Perl Scripts

by Steve Oualline
February 2006
Intermediate to advanced content levelIntermediate to advanced
304 pages
6h 16m
English
No Starch Press
Content preview from Wicked Cool Perl Scripts

#5 Currency Converter

When traveling internationally, it's very easy to become confused by the differences between the various currencies out there. Knowing the exchange rate is vital for international transactions.

Converting between one currency and another is a simple calculation, providing you know the exchange rate. Since rates are continually changing, that can prove to be a bit tricky. This script actually goes to a website maintained by XE.com, downloads the exchange rate, and then performs the calculation. This means that the result will be an accurate conversion using up-to-the-minute rates.

The Code

 1 # 2 # Convert currency from one type to another 3 # 4 # Usage: money.pl <amount><from-code> <to-code> 5 # 6 # Where: 7 # <from-code>, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl Debugged

Perl Debugged

Peter Scott, Ed Wright
Perl & LWP

Perl & LWP

Sean M. Burke
Pro Perl

Pro Perl

Peter Wainwright

Publisher Resources

ISBN: 1593270623Catalog PageErrata