QM has asked for the wisdom of the Perl Monks concerning the following question:

At $work, I often seen modules ending with this line:
1; ## Magic spoon

I understand the reason for 1;, but what is the history of # Magic spoon?

My team is wondering if this was created by the original author of these files, or if it first arose elsewhere. However, Google is not cooperating today, and searches for perl "magic spoon" return pages such as Swords, Sorcery, and the Spoon, which clearly don't match the exact phrase.

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re: Magic Spoon
by Old_Gray_Bear (Bishop) on Nov 13, 2014 at 02:06 UTC
    Iain Truskett uses the nom de CPAN of SPOON on CPAN and MetaCPAN. Perhaps you are using one of the modules that he is Custodian for.

    ----
    I Go Back to Sleep, Now.

    OGB

Re: Magic Spoon
by chacham (Prior) on Nov 12, 2014 at 18:16 UTC

    The magic spoon might be a reference to Uri Geller and Spoon bending (humorously) saying that things might not be as they appear.

      See this advice. Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      The magic spoon might be a reference to Uri Geller and Spoon bending...
      Well, if we're just guessing, sure, why not? But if Uri Geller needs a magic spoon, then it's not spoon bending, is it?

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

        if Uri Geller needs a magic spoon, then it's not spoon bending

        If the result is the same spoon bent, then it most certainly is spoon bending. The question is, did he do it with his mind or not. See the rest of the wikipedia article which reports on the controversy, and his Tonight Show appearance.

Re: Magic Spoon
by SuicideJunkie (Vicar) on Nov 12, 2014 at 18:10 UTC

    A module needs to end with a true value to indicate that it loaded successfully.

    1; or 42; or 'spoooon!'; are all true values that will work.

      I understand the reason for 1;

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

      Posting first works better when you answer the question asked.
Re: Magic Spoon
by karlgoethebier (Abbot) on Nov 12, 2014 at 19:50 UTC
Re: Magic Spoon
by Another Ed (Sexton) on Nov 13, 2014 at 12:39 UTC
    Is it coincidence that "spoon" is "no-ops" reversed?
      Brilliant!

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

Re: Magic Spoon
by DrHyde (Prior) on Nov 13, 2014 at 13:26 UTC

    The string # Magic spoon does not appear anywhere on the CPAN, according to grep.cpan.me, so that must be in your employer's private code.

    What does your source code repository tell you?

      The string # Magic spoon does not appear anywhere on the CPAN, according to grep.cpan.me, so that must be in your employer's private code.
      Agreed.
      What does your source code repository tell you?
      My source code repository is a decade old, and convoluted with branches and merges and lions and tigers and bears. However, I would not expect it to say:
      # Found this in Acme::Bleach, hurray! # ...or... # Joe made this up at the pub last week: 1; # Magic spoon

      It seems a bit wasteful to start a search for the first occurrence in the repository, when the repository already suffers performance-wise, and when it most likely will tell me nothing useful. ("You want to revert 10K file merge? Can you do that on the weekend?") But, the question was worth considering anyway.

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

Re: Magic Spoon
by FloydATC (Deacon) on Nov 13, 2014 at 20:06 UTC

    Windows doesn't have fork() so they had to use 1; # Magic spoon.

    Easy.

    :-P

    -- FloydATC

    Time flies when you don't know what you're doing

Re: Magic Spoon
by QM (Parson) on Nov 13, 2014 at 09:08 UTC
    In hindsight, I'm surprised no one (including us) thought of There Is No Spoon from the Matrix.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Re: Magic Spoon
by karlgoethebier (Abbot) on Nov 13, 2014 at 11:58 UTC
    "Now this spoon is a magic spoon", said Henry..." (From The Boxcar Children by Gertrude Chandler Warner)

    A sophisticated way to comment the 1;? I know, i tend to over-interpret some things.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      Good find! I like it.

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

Re: Magic Spoon
by karlgoethebier (Abbot) on Nov 15, 2014 at 13:47 UTC