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

Re: CUFP: Random tag insertion

by Roy Johnson (Monsignor)
on Nov 25, 2003 at 18:39 UTC ( #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? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2021-12-03 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (29 votes). Check out past polls.

    Notices?