Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-05-27 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found