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

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

This code transforms perl error messages into something more pleasing to the eye: a Larry Wall witticism!

use strict;BEGIN{$SIG{qq)__WARN__)}=sub{$..=$_[$===!$=]}}eval,$..=$@for
qq}bless("Wall","Larry"),Not("Wall","Russ");#},qq!;print Magic,counts!,
qq#use strict;\$Perl=42#,qq>goto"WALL, LARRY ONTO (OR ON?) SOMETHING">,
q~warn+Randal::Nevermind()~;s~~pop~e;$~=/^[1-7]$/?~-$&:rand$=>>$^F+!$%;
@;                                                                   =(
q~                           -F+=->*/+/*+*W*.                        ->
*/                        *.+=*+*.*/+/*+*3*/-B*+*                    ,+
1*                   +*1*\*\*\*,*2*D*2*:*c*W*,+1*\*                  \*
\*                 ]~,q~                         -Z*-                *c
*/               *:*2                              *c*               W*
,+             1*2+                                  1*/             *7
*<           */*.                                   +  =*2           */
+1          *++`                                    *   /*c          +`
*/         +1*+                                  *G  ,    I+=        *.
*2       *:*/                                   *     A    *+*       c*
2*     /*W                                    *,       ->   */*      1*
7*    7,G                                   *2           +   1*/     *7
*D   *2*                                :*/*              c   +`*    /*
3+  =*7                             *G*1                   +   1*2   *:
*/  *+*                         .*]*                        3   *7*  c*
2*  /,,                *2*:*1*/.                            +   */*  A*
7+  1*2              ->                                     *    /*  +*
,+  1*/             *3                                       *   +*  W+
1-  >*/            ,                                         *   -:  +=
*+  *.*            /                                          *W*3*  /*
.+  =*+           *                                              .-  >*
/*  3+/           *          2*+*:*W*,,I-Q,**]~,q~-F*0*D*W*7*G*3*1+  `*
/-  Z*/           +/*+*3*/*2*W    *.+=*2*    :    *   /*7*,*.     *  7*
/*  3*7           *          c *2*  .+=  *W  *    , ,I  ->*  /*7  *  :*
/*  7*,           *          / *3*7*c*2*.+=  *    W *,,I*\*]~,q~  -  ;*
1*  1*/           *          1               *    +               *  ,,
I*  G*   +,I     *           2               *    /+              1  *2
*3  *W   ,  I*,*2            *               :     *3             *  /*
+*  :*   2                   *               /     * +            *  :*
:*  7,   I  *+*               ,*.*\*/+X*7*2*3       * /+/*W*.+=*/*   .+
=*  2*    /                              *          .          *     2*
:*   :     *                            W          *           .     *7
*:    +     `                            * \*\    *            \     */
.R     *      9*T                              *]             ~      ,q
~-      Z       *                  .*-*3*/*.+=*2*/-V*+,I      *      W*
A*       /      *                .+=*+*.*/*A*7*G*,*.*3*\*     ]      ~,
q~        -     B               *+*,+1*+*1*/*A*+*,*/+/*:*W   *       .*
2*         /   *                7*,*2  *9*1*W*,*2*:*3  */*+  ,       I*
+*          W *                 ,*\*  /              -  W*D *        2*
:+           `*                 7*,   *2*/*W*3*/+=*+,=   ,=+         `-
>*            /                                            *         +*
,+            1                                           *          /,
=*            2                                          *           +*
A*           2       *                                  /            *3
,=           *        :                                *             2*
++           1          *                             3              *]
*7           *            D                          *               2*
:*          /               *                       .   +            =*
2*          /                 +                    /     +           =*
7*         1                    *2*              /-       W          *+
*:        *                          .+=*\*]~,q~            -        Z*
/,                                                                   G*
,*7+/*/*W*.*-*3*/+/*2*W*:+1->*/*0*G*.*/*W*.*/+1*7*2*3*/*c*+,G*2*/*W*.*/
*2*+*3*W*2*:*/*.*7*/+/*:*W*.*2*/,=*7*2*.*:+`*/*W*,*/,=*2*:*1*\*/.R*9*T*
]~);s;\s;;gfor@;;@;=map{$;=chop;$=*(-42+ord)-42+ord$;}$;[$~]=~/../g;#;-
print(($.=~/./sg)[@;]) #-!"#$%&'()*+,-./:;<=>?@[\]^_`!"#$%&'()*+ -- /-\
By default, one of seven witticisms is randomly displayed, though you may ask to see a specific witticism by giving a command line argument of 1-7.

Since this program depends on the precise wording of perl's error messages, you might brand it fragile in the extreme. However, I've tested it with perl 5.005, 5.6.0, 5.6.1 and 5.8.3 and found no problems so far. Here's hoping the wording of these carefully chosen perl error messages does not change in future versions of perl. :-)

Update: Put code tags in a comment so download link will work. Thanks ambrus.

In reply to Larry Witticisms from perl Errors by eyepopslikeamosquito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [Your Mother]: What a stupid, yet seductive super power. Control of biting insects.
    [oiskuu]: Don't you think it's disturbing that the washing machine manual would say not to start it with pets inside?
    [oiskuu]: So, how long did it take you to grow up?
    [oiskuu]: Have you ever had your temperature taken from the other end?
    [marto]: I read about a case where people were at a launderette, or whatever they're called in the US, and as a joke, put their toddler in with the washing, then closed the door
    [Your Mother]: (Work in progress.)
    [marto]: unaware that the model in question started the cycle automatically, provided the money/token had already been provided
    [marto]: CCTV footage of the joke gone wrong is used in educational materials now IIRC

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (14)
    As of 2017-12-18 14:56 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      What programming language do you hate the most?




















      Results (487 votes). Check out past polls.

      Notices?