generate spam comment from https://gist.github.com/shanselman/5422230
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
minor nitpick: /r was added in 5.14