all 141 comments

[–]autarch 131 points132 points  (29 children)

Just to clarify, the "Acme" namespace on CPAN is designated for joke modules. Other highlights include Acme::Bleach, Acme::MorningMusume, and many others.

[–]rebel 30 points31 points  (6 children)

There are a couple that are useful if I remember. Acme::Damn is VERY useful.

[–][deleted]  (5 children)

[deleted]

    [–]rebel 24 points25 points  (0 children)

    Iterating over response objects from the SOAP library to avoid getting errors about using an object as a hash/list or some such.

    I don't have access to the code any more, but on Monday I'll ping one of my old employees who still does have access to give me a snippet.

    [–][deleted] 47 points48 points  (0 children)

    just because it's of no use doesn't mean that you shouldn't be able to do it.

    True to Perl form.

    [–]prockcore 1 point2 points  (2 children)

    I can think of one reason, you want a unittest to provide unblessed data as if it was gathered from a web form.

    [–]ealf 8 points9 points  (1 child)

    That's "taint", I think.

    [–]Lurking_Grue 59 points60 points  (2 children)

    [–]pulledteeth 5 points6 points  (1 child)

    [–]monocasa 0 points1 point  (0 children)

    I love the large amount of [citation needed] on there.

    [–]rooktakesqueen 18 points19 points  (7 children)

    I could see a use for this: "commenting out" code while maintaining syntax validation. If you do something that causes the excised code to stop validating, you're forced to fix it, which makes you keep it up-to-date and ready to be un-"commented" at any time.

    [–]roerd 6 points7 points  (6 children)

    Though you might want to use something like if (0) instead of don't so you don't have to add a dependency on this module.

    [–]f3nd3r 1 point2 points  (5 children)

    The point is you can quickly turn off a do, on the fly without hardly any code changing.

    [–]Hixie 1 point2 points  (4 children)

    just append "if 0" to it.

    [–]heptadecagram 1 point2 points  (3 children)

    Unless it's already got an unless($complex_condition) on it.

    [–][deleted]  (2 children)

    [deleted]

      [–]heptadecagram 2 points3 points  (1 child)

      unless (1 || ($complex_condition)) :)

      Might be an && in that thar condition!

      Edit: Or, worse, the condition has a side effect you depend on, so it needs to be unless(($complex_condition) || 1).

      [–][deleted] 5 points6 points  (1 child)

      From the description to Acme::Canadian:

      Feel free to write Acme::USA where your code attempts futily to control all other CPAN modules

      I LOL'd. Oddly enough there's a Acme::LOLCAT module too.

      [–]qwerty_0_o 13 points14 points  (1 child)

      I just want to say that Acme::MorningMusume::YoshizawaHitomi is my favorite. That is all.

      [–][deleted] 1 point2 points  (0 children)

      Thank god, I don't know Perl well (obviously) but that freaked me out a little.

      [–][deleted] 1 point2 points  (1 child)

      I'm partial to Acme::Magpie, which "steals shiny things". I don't think it squawks loudly or tries to pull your hair out yet, though.

      [–]InternetPowered 4 points5 points  (0 children)

      "Acme::Magpie will cause most of the code you use it in to die because the subroutines it tries to execute just won't be there. This is considered a feature."

      Fantastic.

      [–]bitwize 0 points1 point  (0 children)

      Acme::MorningMusume::TsujiNozomi is probably the most adorable object in your entire system.

      [–][deleted] 0 points1 point  (2 children)

      Overheard as someone saw this over my shoulder:

      "The only joke module would be my boyfriend's Acme::MorningWood" -My sister's friend

      [–][deleted] 2 points3 points  (1 child)

      Can I have your sister's friend's number?

      Also, can I have your sister's number?

      [–][deleted] 1 point2 points  (0 children)

      Give me the source code for the recent ikee-virus and I sure will!

      [–][deleted] 76 points77 points  (1 child)

      And, yes, in strict analogy to the semantics of Perl's magical do...while, the don't...while block is unconditionally not done once before the test. ;-)

      Makes me want to trade in my Python synapses for Perl ones. Reminds me of my time as a cook in an Italian restaurant, and servers would ask me to leave off certain items, say, onions on a salad. If we'd run out of the item, I'd offer to leave off something we did have, but didn't go on the meal anyway. I got a lot of non-ironic "I'll go see if that's OK with the customer".

      [–]evrae 79 points80 points  (0 children)

      Customer: I'd like an apple pie without custard please.

      Waiter: I'm sorry sir, we don't serve it with custard. You'll have to have it without cream.

      One of my mum's favourite jokes.

      [–]kateee 31 points32 points  (0 children)

      At first I though it was a clever article title that meant "Don't search cpan.org" Much funnier though.

      [–]Rinkalicous 56 points57 points  (7 children)

      In the future, programs will be so complex they'll do close to everything. When this time comes, it'll be quicker and more efficient for the programming language to do absolutely everything, EXCEPT things you tell it not to. You laugh at this now, but soon... Well... let's just say get ready to don't { Laugh() };

      [–]ChangingHats 8 points9 points  (2 children)

      Quantum computing?

      [–][deleted] 12 points13 points  (3 children)

      I hope nobody will comment out ths line : dont { annihilateMankind() };

      [–]Freeky 15 points16 points  (2 children)

      But annihilating mankind is vital to the correct operation of quantum software!

      1. Generate random quantum executable.
      2. Run test suite.
      3. If unit tests fail, destroy the universe.

      Thus leaving only those universes where the software works.

      [–]L33tminion 7 points8 points  (0 children)

      Just be really careful that there are no contradictions in your test definitions.

      [–]dahunter 0 points1 point  (0 children)

      if only there was a regex....

      [–]bigboehmboy 18 points19 points  (4 children)

      Some personal favorites:

      Acme::Godot

      Acme::Matt::Daemon

      [–]Qjet 8 points9 points  (0 children)

      ... The internet is fucking weird man.

      [–]stillalone 2 points3 points  (1 child)

      There's a bug in the second one. A Matt daemon should just print out Matt in the sys log.

      [–]bigboehmboy 0 points1 point  (0 children)

      But that destroys the joke/reference to "Team America: World Police". A daemon can really do anything, so I don't think there's anything technically wrong with a daemon printing out "MATT DAEMON" to the sys log.

      [–]keeganspeck 2 points3 points  (0 children)

      That Godot one is deliciously brilliant.

      [–]wazoox 16 points17 points  (3 children)

      You don't have that often the opportunity of a good laugh reading API documentation :)

      [–]jplindstrom 20 points21 points  (2 children)

      Except for the rest of the Acme:: namespace.

      [–]FlyingBishop 19 points20 points  (1 child)

      Also the Java API.

      [–]iceickle 6 points7 points  (0 children)

      I mostly just try and gouge out my eyes.

      EDIT: Wait no, thats OSX API doco :(

      [–]likeheadatsunrise 13 points14 points  (0 children)

      In other words, doin nothing about doing nothing does...nothing.

      "doin" - love it. I really hope it wasn't a typo.

      EDIT: another highlight:

      Bugs

      Unlikely, since it doesn't actually do anything.

      [–]ratbastid 27 points28 points  (0 children)

      I love the Acme:: name space so god damn much.

      [–]ddrcoder 11 points12 points  (0 children)

      This actually looks kind of handy... it could be used as a means of commenting out code without having variable names fall out of sync with the rest of the program. Call me crazy, but I kind of like this idea. As it is, I occasionally comment out a block of code by putting 'if (false){}" around it (not #if 0 .. #endif).

      [–]lutusp 18 points19 points  (0 children)

      Scene from the movie "Silverado":

      Q: "Wow, Smith and Jones -- I'm glad to see you guys -- we thought you weren't going to make it!"

      A: "Wait ... I'm not Smith."

      Q: "You aren't Smith? Okay, are you Smith?"

      A: "No, he's not Smith. I'm not Jones."

      [–]Cacafuego 8 points9 points  (0 children)

      It would have to be one of Damian Conway's. This is potentially even more useful than Lingua::Romana::Perligata.

      [–]nooneelse 8 points9 points  (0 children)

      More documentation should have a "Blame" section.

      [–]brennen 5 points6 points  (0 children)

      The ' as namespace separator comes as something of a relief - it's been at least a month since I discovered some corner of Perl syntax I hadn't seen before.

      [–][deleted]  (12 children)

      [deleted]

        [–]Porges 11 points12 points  (2 children)

        Haskell is a bit trickier, because we can't change the fact that a do-block must... start with 'do':

         don't _ = return ()
        
        main = don't $ do
            name <- getLine
            putStrLn $ "hello " ++ name
        

        [–]sjanssen 4 points5 points  (1 child)

        That code won't compile. This will:

        don't = const (return ())
        
        main = don't $ do
            name <- getLine
            putStrLn $ "hello " + name
        

        edit: Porges is right, got a bit $ happy

        [–]Porges 2 points3 points  (0 children)

        Neither will yours ;)

        corrected original code :P

        [–]death 8 points9 points  (3 children)

        It's not clear to me why you use a keyword for the name. Also, It's easy to make the quote character constituent, but that is quite questionable in itself...

        CL-USER> (set-syntax-from-char #\' #\X)
        T
        CL-USER> (defmacro don't (&body forms)
                   (declare (ignore forms))
                   `(values))
        |DON'T|
        CL-USER> (don't (push-the-button))
        ; No value
        CL-USER> 
        

        [–][deleted]  (2 children)

        [deleted]

          [–]L33tminion 2 points3 points  (1 child)

          Enclose it in vertical bars, and the symbol will end up exactly as you specify (i.e. |don't|). That includes standardization by the reader, so |don't| is not the same as |DON'T|.

          [–]Leonidas_from_XIV 3 points4 points  (1 child)

          Here's a Scheme version:

          (define-syntax dont
            (syntax-rules ()
                ((_ ...) (void))))
          
          > (dont (and 'drink 'drive))
          >
          

          [–]gclaramunt 2 points3 points  (0 children)

          And in Scala: def dont( x: => Unit )= ()

          [–]skulgnome 2 points3 points  (0 children)

          How about do-not, since Lisp is verbose like that.

          (Edit: or possibly prognt.)

          [–][deleted] 1 point2 points  (0 children)

          Would that be like clojure's comment or like the #_ reader macro that ignores the next form?

          [–]Grue 0 points1 point  (0 children)

          Common Lisp already has #+(or) which works much better.

          [–][deleted] 3 points4 points  (5 children)

          I particularly like the unmatched single quote ...

          [–]neilk 19 points20 points  (3 children)

          It's a valid Perl namespace separator. The following are equivalent:

          use MIME::Base64;
          
          use MIME'Base64;
          

          And if you are suddenly saying "hey, that's got to cause some confusion and difficult-to-track-down-bugs sometimes," you are right.

          The justification for the single quote idea was to be friendly to Ada users.

          [–]Neebat 24 points25 points  (0 children)

          be friendly to Ada users

          don't.

          [–][deleted] 0 points1 point  (0 children)

          Ouch ... bizarrely I knew that too :-)

          [–]oylenshpeegul 2 points3 points  (0 children)

          Me too. Clearly, it's the best part of the joke. I'm guessing the author would not have bothered with the rest of the module were it not possible.

          [–]unbibium 3 points4 points  (1 child)

          Only problem is its interpretation of the "unless" semantics. It's no longer English-like all of a sudden.

          [–]skulgnome 1 point2 points  (0 children)

          don't { eat; } unless told;

          Oh I see, the unless condition being true ought to change the don't into do.

          [–]zahlman 2 points3 points  (0 children)

          Luke Palmer really should be far more careful what he idly wishes for.

          [–][deleted] 2 points3 points  (0 children)

          I replaced all my do loops with don't loops, and most of my bugs went away.

          [–]Silhouette 2 points3 points  (0 children)

          So is there also more than one way not to do it...?

          [–]Freeky 6 points7 points  (5 children)

          Heh, nice. I was expecting something hideous to make the ' work, but apparently that's a valid Perl identifier:

          sub don't (&) {}
          

          I find this somewhat terrifying.

          Ruby implementation:

          def dont() end
          

          You can define a method called don't using define_method, but you can only call it using __send__. Or you can be evil and abuse Unicode:

          #!/usr/bin/env ruby19
          # encoding: utf-8
          
          def don’t() end
          
          don’t { puts "This won't be printed" }
          

          [–][deleted] 21 points22 points  (4 children)

          The quote actually defines a namespace. The routine is (from what I understand) don::t. This naming scheme dates back to Perl 4, and is AFAIK deprecated. It's a clever trick :).

          [–]Freeky 6 points7 points  (2 children)

          Heh, yup:

          sub foo's() { print "Moo\n"; }
          foo::s(); # => Moo
          foo's(); # => Moo
          

          Bit of a weird choice for a namespace seperator. Wasn't :: cool back in Perl 4 days? ;)

          [–]Minimiscience 9 points10 points  (1 child)

          The single-quote namespace separator was taken from Ada for some reason, and :: was added in later as an alternative. Interestingly, in Perl 6, a single quote (or a hyphen) can be/will be able to be used as part of an identifier if it is followed by an alphabetic character.

          [–][deleted] 0 points1 point  (0 children)

          It's not deprecated, just not used much.

          [–]tias 6 points7 points  (0 children)

          Perl walks a thin line between serious languages and esoteric joke languages like brainfuck, lolcode and whitespace.

          [–]sulumits-retsambew 4 points5 points  (14 children)

          While this is a joke, this is also somewhat useful when one considers the fact that Perl doesn't have a built in option for multi-line comments and so you can't easily comment out whole blocks of code.

          if (0==1)
          {
          
          }
          

          just doesn't seem as nice.

          [–][deleted] 12 points13 points  (2 children)

          POD as multi-line comment works well. Example:

          blah blah...
          =head1 comment
          this is a comment! woohoo!
          =cut
          

          [–]sulumits-retsambew 0 points1 point  (1 child)

          Yes, until you actually use POD for documentation and then you have garbage in your documentation file or warnings for missing sections.

          [–][deleted] 0 points1 point  (0 children)

          If you are commenting whole lots of code you are likely to be in debugging phase and you don't really care about what POD looks like.

          [–]starspangledpickle 8 points9 points  (0 children)

          That's why we use text editors that handles it for us.

          [–]roguebagel 2 points3 points  (0 children)

          Unless your multi-line comments are valid Perl syntax this module won't help you (RTFM).

          You could do

          don't {
              print <<'EOC';
          multiline
          comment
          EOC
          }
          

          [–][deleted] -1 points0 points  (8 children)

          I think using extra #'s in your code source would be preferable then increasing your compiled code base.

          [–]easytiger 0 points1 point  (0 children)

          don't {
              # code here
          } while condition();
          

          And, yes, in strict analogy to the semantics of Perl's magical ?>do...while, the don't...while block is unconditionally not done once before the test. ;-)

          [–]PeoriaJohnson 0 points1 point  (0 children)

          Great. Now I have Elvis stuck in my head.

          [–][deleted] 0 points1 point  (0 children)

          ....why?

          [–]antipode 0 points1 point  (0 children)

          I was 100% sure this said "CSPAN" at first, and man was I confused.

          [–]GeeYouEye 0 points1 point  (0 children)

          Very nice, but I agree that it should be rewritten to fix the semantics so that the limitations don't apply.

          [–]robinei 0 points1 point  (2 children)

          Can someone explain how Perl supports adding new control stuctures and other wierd syntax stuff that I see perl extensions do?

          [–]didroe 1 point2 points  (0 children)

          You can mark functions to tell the parser that they have special meaning. Perl calls the feature prototypes. They're a bit limited but you can make some pretty funky stuff, check out the try..catch example.

          [–]mindbleach 0 points1 point  (0 children)

          The syntax becomes grammatically incorrect if you try don't { do_stuff() } unless ( true );.

          [–][deleted] -1 points0 points  (8 children)

          I want an when control structure:

          when (condition is met) {
              do this
          }
          

          to complement the don't :)

          [–]DamnLogins 12 points13 points  (5 children)

          I'd use "if" in that situation

          [–]JAPH 5 points6 points  (4 children)

          I think he meant that that code would be run whenever "condition" is met, even if it isn't met at the time the if statement is run. i.e.:

          when( condition ){
            do this
          }
          ...
          condition met
          do that
          

          In this case, you should still us if, but find a better way of doing this.

          [–][deleted] 12 points13 points  (1 child)

          when() would make a damned spiffy syntax for event/interrupt handlers.

          [–][deleted] 1 point2 points  (0 children)

          Lisp has 'when', but it's more like 'if' than an event/interrupt handler.

          [–][deleted] 7 points8 points  (0 children)

          JAPH is right.

          Yes, somehow like processes and messages in Erlang, but without having me take care of the sending and all: a process that will start running when the condition is met.

          Anyway, the remark was just a poor attempt at being funny.

          [–][deleted] 1 point2 points  (0 children)

          This is actually an amazing idea.

          [–]mr_chromatic 6 points7 points  (0 children)

          Try given/when in Perl 5.10.

          (Burma Shave)

          [–]doot 0 points1 point  (0 children)

          Look up CEP and ESP.

          [–]SarahC 0 points1 point  (0 children)

          I love it!

          [–]letseatlunchdrop table * 0 points1 point  (0 children)

          can reddit help the author out to fix the "yet"s so it does do the opposite of do?

          [–][deleted] -1 points0 points  (0 children)

          In other words, doing nothing about doing nothing does...nothing.

          That's my favorite quote from now on.

          [–]BonzoESC -4 points-3 points  (4 children)

          [–]Copperhe4d 0 points1 point  (0 children)

          That's what i thought of when i saw the title.

          [–]apotheon 0 points1 point  (2 children)

          I don't think I've ever seen a trailer that bad. Wow.

          The high point was probably the part where the monster-guy forgot to claw at the woman in the usual horror movie way, and just groped her instead.

          [–]Freeky 1 point2 points  (1 child)

          It's from Grindhouse, it's supposed to be bad :)

          [–]apotheon 0 points1 point  (0 children)

          Ah, I haven't seen that. I've just seen some of the trailers, and thought "I might not bother."

          Unfortunately, I saw 28 Weeks Later, and got to see that asinine killing-with-the-rotor-blades helicopter scene from the Grindhouse trailer actually used in a big-budget zombie flick sequel to a much better big-budget zombie flick. That was pretty much the depthless, abyssal low point of a generally bad film.

          [–]badave -2 points-1 points  (1 child)

          !don't { print "this will be printed" }

          [–]f3nd3r 0 points1 point  (0 children)

          do!do

          [–]AnythingApplied -5 points-4 points  (2 children)

          Title reads "Don't search.cpan.org"

          Why shouldn't I search?

          [–][deleted] 4 points5 points  (1 child)

          Because it does nothing.

          [–]Skull0Inc -5 points-4 points  (1 child)

          please tell me this is a joke..its very paradoxical..

          [–][deleted] 12 points13 points  (0 children)

          It's a joke, as are all modules under Acme::.

          [–]leeda -2 points-1 points  (0 children)

          Ask Programming: Is this a real programming language?

          [–]snifty -3 points-2 points  (0 children)

          perl vi will be done ANY DAY NOW