Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
#!/usr/bin/perl # The Daily Travels of a PerlMonk # a few definitions before we continue ... our @worthy_nodes = ( 'informative', 'insightful', 'interesting', 'hum +ourous' ); our @unworthy_nodes = ( 'plagarism', 'demeaning', 'rude', 'insulting' +); # our votes are a function of the voting and experience system our $votes = { 'initiate' => 0, 'novice' => 5, 'acolyte' => 8, 'scribe' => 12, 'monk' => 16, 'friar' => 20, 'abbot' => 25, 'bishop' => 30, 'pontiff' => 35, 'saint' => 40, # 'vroom' => ??? How do you define an infinite? undef? }; # my level is a function of my xp, my votes are in turn derived from + my level my $level = &{ $xp }; my $votes = $votes{ $level }; # while not working ... yeah, right - should this be while (1) ? PM: while (!$work) { # iterate through our newest nodes, from the newest to the last +checked node our $newest_nodes; foreach $node ( $newest_node .. $last_checked_node ) { # should this be $content = &read( $node ) && eval $content +? &read( $node ); # if I have votes remaining ... if ($votes) { if ( eval { # evaluate if the node contains elements of @worthy_ +nodes grep { $node =~ /$_/ } @worthy_nodes }) { --$votes && $node++; # vote up the node my $xp += &{ $chance }; # xp changes as a functi +on of chance } elsif ( eval { # evaluate if the node contains elements of @unworth +y_nodes grep { $node =~ /$_/ } @unworthy_nodes }) { --$votes && $node--; # vote down the node my $xp += &{ $chance }; # xp changes as a functi +on of chance } else { next # move onto the next node } } else { next # move onto the next node } } } continue { goto PM; } exit; # should never be reached ... if it is, something drastic ha +s gone wrong!

 

perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'


In reply to The Daily Travels of a PerlMonk by rob_au

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!
  • 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?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (5)
    As of 2015-07-04 03:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (57 votes), past polls