http://qs1969.pair.com?node_id=50612

Last Saturday, a few of the Silicon Valley monks (namely neshura, redmist, myself and my significant other) went playing pool. The way I'm used to playing pool back home is a bit different than the pool played in the US. (Even when Brazilians play slop, we are still much more strict than the American slop pool)

Some of these differences spawned the bizarre idea that there should be a counterpart for use strict. You know? For those who can't code even to save their lives? use slop would be the "miracle worker" for those days in which you really don't feel like checking syntax or being correct. use slop wouldn't warn you if anything went wrong, it would just let it slide and preferably ommit errors and just ignore the existance of STDERR, or even STDOUT at times! I mean, if you're really gonna get sloppy, why even check for output?

And now, for your nightmare of coding pleasure - I think we would go something like this:
#!perl # its not in your path?? use slop; # remember 'dis, Ma? require 'cgi-lib.pl'; # yes, its a typo REadParse(); # and who cares about string types? if ($in{user{ == BBQ and $in{password} == 'phooey') # or braces? # why indent? why print a content type? print $a_variable_thats_going_to_be_def_l8er ifelse # yeah, why not? warn 'it didn't work' # oops, should i have escaped that? # well, you get the idea return('foo');
Okay, it actually does't look as bad I thought it would, but maybe that's just because it actually looks like code a write every once in a while. use slop++

#!/home/bbq/bin/perl
# Trust no1!

Replies are listed 'Best First'.
Re: use slop;
by OeufMayo (Curate) on Jan 09, 2001 at 13:23 UTC

    Actually, this sloppy module (well part of it) exists! It's called Symbol-Approx-Sub (from a new saint) and it allows calling subs with approximate name.

    Now, that could be useful if it could switch on automatically at predefined hours (until 1st caffeine shot, ...), but then I guess you'll have to interface your coffee machine with this module.

    <kbd>--
    PerlMonger::Paris(http => 'paris.pm.org');</kbd>

      Thanks for the plug :)

      Actually, Symbol::Approx::Scalar is also getting close to completion and we have plans for Symbol::Approx::X modules for all typeglob objects. There's an article about all this in the new issue of TPJ (if it ever gets printed) and there's a mailing list for the discussion of these modules at:

      --
      <http://www.dave.org.uk>

      "Perl makes the fun jobs fun
      and the boring jobs bearable" - me

        Just as something to look at, davorg, look at this node I wrote a while back - RE: Factory Pattern for Class Heirarchy. It's not approximate matching, but it's interesting and related to the 'use slop' discussion above.

(Ovid) Re: use slop;
by Ovid (Cardinal) on Jan 09, 2001 at 07:12 UTC
    Said BBQ:
    The way I'm used to playing pool back home is a bit different than the pool played in the US.
    That reminds me of the time I traveled to the UK to visit my brother (he's British and I'm a citizen of the USA). He took me to a pool hall and asked if we could play "American style" pool. Needless to say, the British idea of how Americans play it is rather amusing and I kept chuckling about their assumptions.

    Later on, my brother had a particularly difficult shot. I suggested he put a little "left English" on it. That earned me an interesting look from everyone.

    Hoist on my somewhat less than multi-cultural petard :)

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      I'm still trying to figure out which one is that "qeue ball" you Americans refer to so often. And how come you never use a bucket of soy sauce when playing pool?
      /me shrugs

      #!/home/bbq/bin/perl
      # Trust no1!
Re (tilly) 1: use slop;
by tilly (Archbishop) on Jan 09, 2001 at 07:26 UTC
    For an excellent example of usage see the implementation of class Pig...
Re: use slop;
by extremely (Priest) on Jan 10, 2001 at 03:39 UTC
    I'd like to see "use Typo;" or "use WhatIMean;" to be implemented. =)

    --
    $you = new YOU;
    honk() if $you->love(perl)

      In that train of thought there could be a
      use YouFigureItOutCauseIDontHaveAClue;

      ;)

      #!/home/bbq/bin/perl
      # Trust no1!
        use YouFigureItOutCauseIDontHaveAClue;

        Ooh, can I fill in that module?

        Just give it an AUTOLOAD routine that does the equivalent of "rm -rf /" except a bit more portably.

        Consider this encouragement to be careful. :-)