Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: CUFP: Random tag insertion

by Roy Johnson (Monsignor)
on Nov 25, 2003 at 18:39 UTC ( [id://310007]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for (my $pos = length($text); $pos ; --$pos)
    {
    ...
           substr($text, $pos-1, 1) = "$opening_tag$char$closing_tag";
       }
    }
    
  2. or download this
    $text =~ s/(\S)/(int rand 2) ? "$opening_tag$1$closing_tag" : $1/ge;
    
  3. or download this
    my $tag_is_open = 0;
    for (my $pos = length($text); $pos > 0; )
    ...
       else { --$pos }
    }
    $text .= $closing_tag if $tag_is_open;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2024-04-25 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found