Mailinglist Archive: opensuse (2532 mails)

< Previous Next >
Re: [opensuse] Quick Perl Question #2 - Why does chomp($float); = "1"?
  • From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
  • Date: Sat, 03 May 2008 15:33:08 -0500
  • Message-id: <481CCC04.6070803@xxxxxxxxxxxxxxxxxx>
Randall R Schulz wrote:
On Saturday 03 May 2008 13:13, David C. Rankin wrote:
Listmates,

Chomp is not a function in the sense you're using it. It alters the variable you pass in-place, rather than returning the "comped" value.

Change that line to this:

chomp($TEMPC); # Works! Removes New Line from Number


By the way, there's a typo in the output line.


--
David C. Rankin


Randall "I told you so" Schulz

[kicking self for a stupid mistake!]

Thank you Randall and Anders. I remember reading exactly that -- about 400 pages ago. And I thought I could master this a 2-3 days... Hah!

All and all, I really am beginning to enjoy perl. And all of this fun just to avoid having to type gcc between edits....

--
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups