The code was a joke, and I was rather irritated when people write to me to 'correct' it."nosehair" while s/(.{1,3})\*/*,$1/;
Today I got mail from someone who complained that the string "nosehair" generated a 'Useless use of constant in void context' warning under -w, and suggested that I change it to 1 instead. I thought this was a little silly, because you should not have to turn on -w to know that "nosehair" is a bad idea.
One of the big problems with -w is that some people have it wired to a toggle switch and when they turn on -w they disable their brains at the same time.
Anyway, I suggested that if this guy's only problem with "nosehair" was that it generated a warning under -w, he could make the warning go away with the following change:
"ignore my nose hairs, please" while s/(.{1,3})\*/*,$1/;
That's the obfuscation. The puzzle is, why does changing the string make the warning go away?
I will reveal the answer in a couple of days; or you can find it on page 321 of the pink camel book.
(Please don't post spoilers, especially if you were hanging around when I explained it in the chatbox this afternoon. Also if you are Randal, then we already know that you know the answer, since you are an author of the pink camel book.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to make warnings disappear
by Dominus (Parson) on Dec 16, 2000 at 21:43 UTC | |
by Dominus (Parson) on Dec 18, 2000 at 22:09 UTC | |
Re: How to make warnings disappear
by merlyn (Sage) on Dec 15, 2000 at 07:52 UTC | |
by Dominus (Parson) on Dec 15, 2000 at 08:11 UTC | |
Re: How to make warnings disappear
by Aristotle (Chancellor) on Jul 04, 2013 at 23:16 UTC | |
Re: How to make warnings disappear
by japhy (Canon) on Dec 15, 2000 at 09:25 UTC | |
by a (Friar) on Dec 15, 2000 at 10:32 UTC | |
Re: How to make warnings disappear
by autark (Friar) on Dec 16, 2000 at 01:16 UTC | |
by Dominus (Parson) on Dec 16, 2000 at 01:18 UTC | |
by autark (Friar) on Dec 16, 2000 at 01:46 UTC | |
by Dominus (Parson) on Dec 16, 2000 at 04:29 UTC | |
by autark (Friar) on Dec 16, 2000 at 18:35 UTC | |
Re: How to make warnings disappear
by ambrus (Abbot) on Oct 11, 2007 at 06:29 UTC | |
Re: How to make warnings disappear
by jima (Vicar) on Dec 15, 2000 at 20:03 UTC |