Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Shoot yourself on the foot

by stefp (Vicar)
on Jan 23, 2002 at 20:40 UTC ( #140926=perlmeditation: print w/replies, xml ) Need Help??

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.


      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.


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)


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.


(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.
    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.

    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> 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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://140926]
Approved by root
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-12-10 05:52 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (38 votes). Check out past polls.