This is an interesting feature of Perl that's recently come up on p5p as a candidate for removal. Not obfuscated, but obscure certainly.
#!/usr/bin/env perl use warnings; "pointy haired boss"; "dilbert"; "dogbert"; "wally";
Outputs:
Useless use of a constant ("pointy haired boss") in void context at sc +ratch.pl line 5. Useless use of a constant ("dogbert") in void context at scratch.pl li +ne 7. Useless use of a constant ("wally") in void context at scratch.pl line + 8.
What? Why doesn't "dilbert" generate a warning?
Turns out that before pod became the standard for Perl documentation, people used to embed strings of nroff in Perl scripts. Any strings that begin with "di", "ds" or "ig" look enough like bits of nroff to be exempt from the void warning.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dilbert don't warn!
by ambrus (Abbot) on Jul 08, 2013 at 10:43 UTC | |
|
Re: Dilbert don't warn!
by choroba (Cardinal) on Jul 08, 2013 at 10:56 UTC | |
|
Re: Dilbert don't warn!
by hdb (Monsignor) on Jul 08, 2013 at 09:44 UTC | |
|
Re: Dilbert don't warn!
by LanX (Saint) on Jan 04, 2014 at 08:49 UTC |