you forgot to chomp both your currency holders. Both contain a newline at
the end, but the second one _appears_ ok to your eyes coz its the end of the
line. You should chomp both (as shown below), and then format your output
with any newlines if necessary...

|-----Original Message-----
|From: Vineet Pande [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, May 25, 2005 2:30 PM
|To: beginners@perl.org
|Subject: output in a single line
|
|
|Hi
|I tried the following script
|
#!/usr/bin/perl
use warnings;
use strict;
print "Currency converter\n\nPlease enter the exchange rate:     ";
our $rupee_c1 = <STDIN>;
chomp($rupee_c1) ;
print "Please enter the Amount in Rupees:   ";
our $rupee = <STDIN>;
chomp($rupee) ;
print "$rupee rupees are ", ($rupee/$rupee_c1), " Euros\n";

when i execute this, i get
|
|Currency converter
|
|Please enter the exchange rate:     56
|Please enter the Amount in Rupees:   560
|560
|rupees are 10 Euros
|I AM  NOT ABLE TO UNDERSTAND WHY 560 IS FOLLOWED BY RUPEES ARE 10 EUROS IN
|THE NEXT LINE.  IS IT THE FAULT OF print "$rupee..........BECAUSE
|WHEN I SAY
|PRINT "560 ...., INSTEAD OF VARIABLE NAME, I GET THE OUTPUT IN A SINGLE
|LINE.
|
|
|Any help appreciated
|cheers
|vineet
|
|"The future belongs to those who believe in the beauty of their dreams"
|-Eleanor Roosevelt
|
|_________________________________________________________________
|Express yourself instantly with MSN Messenger! Download today it's FREE!
|http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
|
|
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|<http://learn.perl.org/> <http://learn.perl.org/first-response>
|
|


*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or 
attachment(s) if any) are privileged and confidential material of MBT and 
should not be disclosed to, used by or copied in any manner by anyone other 
than the intended addressee(s).   In case you are not the desired addressee, 
you should delete this message and/or re-direct it to the sender.  The views 
expressed in this E-mail message (including the enclosure(s) or attachment(s) 
if any) are those of the individual sender, except where the sender expressly, 
and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of 
any virus.  However, it is the responsibility of the recipient to ensure that 
it is virus free and MBT is not responsible for any loss or damage arising in 
any way from its use

*********************************************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to