Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Dilbert don't warn!

by tobyink (Abbot)
on Jul 08, 2013 at 09:38 UTC ( #1043056=obfuscated: print w/replies, xml ) Need Help??

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";


Useless use of a constant ("pointy haired boss") in void context at sc line 5. Useless use of a constant ("dogbert") in void context at li +ne 7. Useless use of a constant ("wally") in void context at 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.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re: Dilbert don't warn!
by ambrus (Abbot) on Jul 08, 2013 at 10:43 UTC

    NOOO! The want to break another of my precious obfus, namely Digisig this time?

Re: Dilbert don't warn!
by choroba (Bishop) on Jul 08, 2013 at 10:56 UTC
Re: Dilbert don't warn!
by hdb (Monsignor) on Jul 08, 2013 at 09:44 UTC

    Do you think this is one of the reasons why Scott Adams called Dilbert Dilbert?

Re: Dilbert don't warn!
by LanX (Bishop) on Jan 04, 2014 at 08:49 UTC
    hmm interesting.

    I missed that discussion during my holidays.

    Maybe a drift, but if the parser already has the ability to special case void strings, then this could be a chance to implement docstrings ... :)

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://1043056]
Front-paged by Corion
NodeReaper practices with his stiletto

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2018-05-27 00:08 GMT
Find Nodes?
    Voting Booth?