Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Tribute to Metasyntactic Variables

by higle (Chaplain)
on Sep 19, 2001 at 00:46 UTC ( [id://113205]=obfuscated: print w/replies, xml ) Need Help??

Metasyntactic variables. We all use 'em. We all love 'em. What would our examples be, without the ubiquitous foo, bar, and even baz? Could we possibly go on coding sanely if we couldn't throw our inside jokes into code that our suit-y bosses will never see?

This, my bretheren and sisteren, is my Tribute to the Metasyntactic Variable. D/L the code, save it to a file (preferably foo.pl), run it, and it randomly spits out a little metasyntactic treat!

Enjoy,
higle

Update: "prettied" up the FOO
#!/usr/bin/perl -w use strict; for($[..(eval($[-$[**$[+1))){$\=$/;my$bar; while(<DATA>){chomp;s;[\s]+;;g;$bar.=$_;} my@baz=split(/\\\|/,$bar);my@foo=map{chr if defined $_}(split(/\\/,$baz[rand@baz])); my$foo;foreach(@foo){$foo.=$_;} $_=$foo;print;}__DATA__ 102\111\111\|98\97\114\ |98\97\12 2\|98\97\ 114\102\|109\117\109\98\ 108\101\|113\117 \120\|113\117\11 7\120\|113\117\117\117\120\|98\97\12 2\111\1 08\97\ |122\11 6\101\115\99\104\|116\104\117\100\|1 03\114\ 117\11 0\116\ |98\108\101\116\99\104\|102\117\109\ |106\10 5\109\ |115\10 4\101\105\108\97\|98\97\114\110\101\ 121\|10 2\114\ 101\100 \|99\111\114\103\101\|103\114\97\117 \108\11 6\|102 \108\97 \114\112\|102\108\97\114\98\|122\120 \99\|11 5\112\ 113\114 \|119\111\109\98\97\116\ |115\1 04\109\ 101\|9 8\111\1 10\103\111\|115\112\97\ 109\|1 01\103\ 103\11 5\|115\ 110\111\114\107\|122\11 1\116\ |98\108 \97\11 4\103\| 119\105\98\98\108\101\| 119\11 1\111\1 16\|11 6\111\1 16\111\|116\105\116\105 \|116\ 97\116\ 97\|11 6\117\1 16\117\|112\105\112\112 \111\| 112\108 \117\1 16\111\ |112\97\112\101\114\105 \110\1 11\|97\ 97\112 \|110\1 11\111\116\|109\105\101 \115\| 111\111 \103\1 08\101\ |102\111\111\103\108\10 1\|98\ 111\111 \103\1 08\101\ |122\111\114\107\|98\11 1\114\107\|103\ 111\114\107\|10 2\111\111\98\97\114\|10 2\111\111 \98\97\122

Replies are listed 'Best First'.
(jeffa) Re: Tribute to Metasyntactic Variables
by jeffa (Bishop) on Sep 19, 2001 at 01:14 UTC
    NICE!!!!

    but is sheila really a metasyntactic variable? hmmm, that inspires me . . . .

    From this moment forth, i shall cast down my metasyntactic ways of qw(foo bar baz qux) and start using monk names!

    use strict; use LWP; use HTTP::Request::Common; use HTTP::Cookies; use constant URL => 'http://www.perlmonks.org/'; my $kudra = join(' ', @ARGV); my $jcwren = $ENV{'HOME'}; my $merlyn = LWP::UserAgent->new(); $merlyn->agent('chat_poster/1.0 (' . $merlyn->agent() .')'); $merlyn->cookie_jar(HTTP::Cookies::Netscape->new( file => "$jcwren/.netscape/cookies", autosave => 1 )); my $OeufMayo = POST(URL, Content => [ op => 'message', message_send => 'talk', message => $kudra, ] ); my $chromatic = $merlyn->request($OeufMayo);

    jeffa

      I guess, according to the Jargon Lexicon, the concept of using hapless, random individuals' names as scratch variables is supposed to be a foreign one to us Yanks. Especially those of us from Tennessee, as it was quite disconcerting to me as I was coding it :)

      higle
      A native Knoxvillian
        <html> Yank? Tennessee? Within five words of each other? Not possible unless used in some demeaning manor. I like your Code J, its nice. Now I know what your doing when your supposed to be updating the OLR!

        *Wink Wink*

        DeF

        Velocity

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-18 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found