Re: output in a single line
- From: offer.kaye@xxxxxxxxx (Offer Kaye)
- Date: Wed, 25 May 2005 14:25:02 +0300
On 5/25/05, Manav Mathur wrote:
>
> our $rupee = <STDIN>;
> chomp($rupee) ;
Vineet,
This is a quote from "perldoc perlop":
"In scalar context, evaluating a filehandle in angle brackets yields
the next line from that file (the newline, if any, included),"
Manav's solution involves removing the newline using chomp. You can
also write this in one line if you want (read "perldoc -f chomp" for
details):
chomp(our $rupee = <STDIN>);
Finally and unrelated, unless you have a very good reason to make
$rupee and $rupee_c1 global, I would change the declaration to "my"
instead of "our". Don't use globals without a good reason, it's a bad
habit :-)
Cheers,
--
Offer Kaye
.
- References:
- output in a single line
- From: Vineet Pande
- RE: output in a single line
- From: Manav Mathur
- output in a single line
- Prev by Date: Re: perl 'advancing' variable facility..
- Next by Date: RE: perl 'advancing' variable facility..
- Previous by thread: RE: output in a single line
- Next by thread: how to efficiently sort hash without using keys()
- Index(es):
Relevant Pages
|