Skip to content

Instantly share code, notes, and snippets.

@miyagawa miyagawa/spamcomment.pl
Last active Dec 16, 2015

Embed
What would you like to do?
generate spam comment from https://gist.github.com/shanselman/5422230
#!/usr/bin/env perl
use strict;
use LWP::Simple;
sub pick { $_[rand @_] }
my $text = get "https://gist.github.com/shanselman/5422230/raw/9863d88bde2f9dcf6b2e7a284dd4a428afdc8c8b/gistfile1.txt";
my @samples = split /\|\n/, $text;
my $template = pick @samples;
$template =~ s/\{(.*?)\}/pick split('\|', $1)/egs;
print $template, "\n"
@eldridge

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.