http://www.perlmonks.org?node_id=140926

This page describes the many ways computer languages help you to shoot yourself in the foot. What would be your entry for Perl?

-- stefp -- check out TeXmacs wiki

Replies are listed 'Best First'.
Re: Shoot yourself on the foot
by drinkd (Pilgrim) on Jan 23, 2002 at 21:03 UTC
    You wouldn't dream of handrolling your own routine to shoot yourself in the foot due to the expeted abuse from your fellow monks for reinventing the wheel, so . . .

    You search CPAN and eventually find SUICIDE:LITE which contains the sub footshoot. You download, install, read the docs and find out it only works through OO, so go lookup what -> does again, and after 6 hours you have a 37 character implementation. That is immediately trumped by somebody elses 35 character implementation which leaves out one set of supurfluous perens.

    drinkd

      very sorry... hopefully i can delete these extras soon... newbie mistake :(
        While feverishly trying to create an elite script to shoot yourself in the foot, you realize that the very appendage to be shot no longer appears. In the panic, you right a different application to run to try and correct this horrendous mistake, however while frantically hacking this program, you make a fatal mistake, and the leg that is sans foot, falls off. At this point, you are more frantic than a cat in an old warehouse, you think you may have patched the code and your fingers fall off. Now, you begin typing with your nose. Running through every different method you can think of to create a panacea to fix the bug, you accidently run the program (because your nose eye coordination is a bit on the shabby side) and your head falls off. So now you are torso, leg, and decapitated head, and you decide it is no longer worthwhile to attempt to shoot yourself in the remaining foot, because you have obtained this objective in a different manner, and hey is that not what Perl is all about!?

        "Your Pro-mop anti-horse agenda has been apparant for some time!"
Re: Shoot yourself on the foot
by FoxtrotUniform (Prior) on Jan 23, 2002 at 22:21 UTC

    You grep through a list of your body parts, shooting the bits that look like feet. On the first try, you don't shoot anything, and realize that you're matching hashrefs instead of scalars. On the second try, you shoot off your big toe instead of the whole foot (shouldn't have used greedy matching in the regex). Finally, you shoot yourself in the foot, generalize your code to allow it to shoot anyone anywhere, and post it on CPAN as SUICIDE::LITE.

    Alternately, you post to Perl Monks asking the regulars to write a finite automaton for you, and get your foot blown off by tilly for your trouble.

    --
    :wq

Re: Shoot yourself on the foot (boo) (ot)
by boo_radley (Parson) on Jan 23, 2002 at 21:42 UTC
    how about :
    While prosletyzing to the masses about the large number of ways you can shoot yourself, Guido van Rossum shoots you in the foot for being so darn smug.
    I'll be here all night; don't forget to tip your servers, folks.
Re: Shoot yourself on the foot
by xphase_work (Pilgrim) on Jan 23, 2002 at 21:24 UTC
    You forget to:
    use strict; use warnings; use CGI;
    So various members of perlmonks take turns shooting you in the foot.

    UPDATE: Here's a new slogan: TMTOWTSYITF(There's more than one way to shoot yourself in the foot)

    --xPhase

Re: Shoot yourself on the foot
by jlongino (Parson) on Jan 23, 2002 at 22:12 UTC
    You forget to scope/localize and shoot everyone on the planet in the $foot.

    --Jim

(crazyinsomniac) Re: Shoot yourself on the foot
by crazyinsomniac (Prior) on Jan 24, 2002 at 01:55 UTC
    Here it is, straight from the "olden times" of pm, as it appeared on my homenode for some time:
    And now it has come time to Shoot Yourself in the Foot with PERL
    You stab yourself in the foot repeatedly with an incredibly large and very heavy Swiss Army knife.
    or
    You pick up the gun and begin to load it. The gun and your foot begin to grow to huge proportions and the world around you slows down, until the gun fires. It makes a tiny hole, which you don't feel.
    That was an excerpt from the famed "How to Shoot yourself in foot in $programmingLanguage". Here's my version:
    You stab yourself in the foot repeatedly with an incredibly large and very heavy Swiss Army knife, causing a big mess, but accomplishing your goal. Some time later, you figure out how to take apart the knife and use it properly, so you stab yourself again, but with greater precision and ease.

     
    ______crazyinsomniac_____________________________
    Of all the things I've lost, I miss my mind the most.
    perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Re: Shoot yourself on the foot
by count0 (Friar) on Jan 23, 2002 at 21:05 UTC
    After staring at the 42 barrels (pointed in 42 different directions), you pick up this facinating gun only to have it shoot holes in every part of you *except* your feet.
Re: Shoot yourself on the foot
by grep (Monsignor) on Jan 23, 2002 at 22:17 UTC
    It doesn't look like a gun only a bunch of leaning toothpicks and the bullet stays in your foot till you stop running.

    grep
    grep> cd pub
    grep> more beer
Re: Shoot yourself on the foot
by Aristotle (Chancellor) on Jan 23, 2002 at 23:55 UTC
    Using all sorts of obscure tricks, you reduce yourself to an identically functioning version that has no bullet, no gun and no foot.

    Makeshifts last the longest.

Re: Shoot yourself on the foot
by TomK32 (Monk) on Jan 24, 2002 at 00:36 UTC
    First method: After you shot yourself into the foot with a quick one-liner no one except you understands how and why you did it and while explaining your one-liner you die.

    Second method: Because you're a pacifist and prefer free sex and beer instead of weapons you decide to undef your foot and accidently (you enither used strict nor warnings) you loose both legs up to the knees

    --
    paco for president
    TomK32 - just a geek trying to change the world

Re: Shoot yourself on the foot
by tadman (Prior) on Jan 25, 2002 at 03:10 UTC
    Succinctly: TMTOWTSYITF.