Skip to content

Instantly share code, notes, and snippets.



Last active Dec 16, 2015
What would you like to do?
generate spam comment from
#!/usr/bin/env perl
use strict;
use LWP::Simple;
sub pick { $_[rand @_] }
my $text = get "";
my @samples = split /\|\n/, $text;
my $template = pick @samples;
$template =~ s/\{(.*?)\}/pick split('\|', $1)/egs;
print $template, "\n"

This comment has been minimized.

Copy link

@eldridge eldridge commented Apr 25, 2013

minor nitpick: /r was added in 5.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment