thevoid has asked for the wisdom of the Perl Monks concerning the following question:
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.#!/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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Output split over two lines
by shmem (Chancellor) on Dec 23, 2006 at 17:46 UTC | |
by thevoid (Scribe) on Dec 23, 2006 at 17:47 UTC | |
|
Re: Output split over two lines
by idsfa (Vicar) on Dec 23, 2006 at 17:47 UTC | |
|
Re: Output split over two lines
by ikegami (Patriarch) on Dec 23, 2006 at 17:47 UTC | |
|
Re: Output split over two lines
by thevoid (Scribe) on Dec 23, 2006 at 17:46 UTC | |
|
Re: Output split over two lines
by thevoid (Scribe) on Dec 23, 2006 at 17:50 UTC | |
|
Re: Output split over two lines
by ysth (Canon) on Dec 24, 2006 at 10:44 UTC | |
|
Re: Output split over two lines
by wjw (Priest) on Dec 27, 2006 at 03:52 UTC |