Here is something to write test data because that was more fun and I am not helpful (sometimes, not always). :P
#!/usr/bin/env perl use strict; use warnings; use Data::Random qw(:all); use Getopt::Long; use URI; GetOptions( "categories=i" => \my $cats, "max-resources=i" => \my $max, "min-resources=i" => \my $min ) or die "Error in command line arguments\n"; $cats ||= 3; $max ||= 7; $min ||= 2; die "min-resources cannot be higher than max-resources" if $min > $max; for my $cat ( 1 .. $cats ) { printf "# <%s>\n\n", join " ", map uc, rand_words( min => 1, max = +> 8 ); for ( 1 .. $min + rand($max-$min+1) ) { my $name = join " ", map ucfirst, rand_words( min => 1, max => + 5 ); my @uri; push @uri, "www" if rand(1) > .5; push @uri, map lc, rand_words( min => 1, max => 3 ); push @uri, [qw/ com org co uk jp de nl /]->[rand 7] for 1 .. r +and(2); my @path = map lc, rand_words( min => 0, max => 3 ); my @query = map lc, rand_words( min => 0, max => 6 ); pop @query if @query % 2; my $uri = URI->new( join("/", join(".", @uri), @path) ); $uri->query_form(@query); my $desc = ucfirst join " ", map lc, rand_words( min => 3, max + => 9 ); printf "[%s] (%s) %s.\n\n", $name, $uri, $desc; } }
For actual feedback: POD (pod) is preferable to comments (usually, not always), lexical filehandles (open) are better than bareword, and real or at least mocked up test data is easier to work on so will elicit more helpful answers than mine… which in creating such might help elicit more helpful answers after all.
In reply to Re: RFC: My first GitHub contribution
by Your Mother
in thread RFC: My first GitHub contribution
by dollar_sign
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |