цветной код

Date: 2007-03-21 12:13 pm (UTC)
#!/usr/bin/perl -l

$pattern = "Я [сразу|немедленно] [пошёл|поехал|пополз|попёрся] разбираться с [делами|братками].";

print "$_" for(@{mutate($pattern)});

sub mutate {
    my (@m, $s, $w);

    while($s = pop@_) {
        if($s =~ /\[(.*?)\]/) {

            for$w(split '\|',$1) {
                $_ = $s;

                s/\[(.*?)\]/$w/;
                push @_,$_;

            }
        } else {
            push @m, $s;

        }
    }
    return \@m;
}


This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

December 2024

S M T W T F S
1234567
891011121314
15161718192021
22232425 262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 2nd, 2026 09:15 am
Powered by Dreamwidth Studios