#!/usr/bin/perl # convert3.pl use warnings; use strict; my ($value, $from, $to, $rate, $rates, %rates); %rates = ( pounds => 1, USD => 1.6, marks => 3.0, "french francs" => 10.0, yen => 174.8, "swiss francs" => 2.43, drachma => 492.3, euro => 1.5 ); print "Enter your starting currency: "; OUTER0: while () { chomp; INNER0: for $from (%rates) { last OUTER0 if $from eq $_; } } print "Enter your target currency: "; OUTER1: while () { chomp; INNER1: for $to (%rates) { last OUTER1 if $to eq $_; } } print "Enter your amount to convert: "; $value = ; $rate = $rates{$to} / $rates{$from}; print "$value $from is ",$value*$rate," $to. \n";