Hi all,
I'm new to programming and have started on a "Beginning Perl" tutorial. I'm having a few problems and am hoping someone here can shed some light :)
One of the first exercises was to write a program for a basic currency converter, here's what I did -
#!/usr/bin/perl -w
#currency2.plx
use warnings;
use strict;
print "Currency converter\n\nPlease enter the exchange rate: ";
my $yen = <STDIN>;
print "Now please enter a price to convert\n";
print "Price:";
my $price = <STDIN>;
print "$price Yen is ", ($price/$yen), "pounds\n";
The problem is that when it prints the answer (line 10) it splits it over two lines, with the amount $price on the first line and rest - Yen is... - on the next. Why is this?
At this stage I'm just using Windows notepad and running the program in the command prompt as I haven't gotten as far as using a proper text editor yet.