您提供的信息不多,但这里有一个(非常简单的)方法可以帮助您入门。
代码
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use URI;
use URI::QueryParam;
# prepare
my @all = map {chr $_} 32 .. 126;
my @word = grep /\w/ => @all;
# randomization helpers
sub rand_number { 1 + rand 10 }
sub rand_param_name { join '' => map {$word[rand @word]} 1 .. rand_number }
sub rand_param_value { join '' => map {$all[rand @all]} 1 .. rand_number }
# create three uris with randomized parameters
for (1 .. 3) {
# prepare
my $uri = URI->new('http://s.example.com/x');
# add randomized parameters
$uri->query_param(rand_param_name() => rand_param_value)
for 1 .. rand_number;
# done
say $uri;
}
输出
http://s.example.com/x?TC10=MX3+B_i!
http://s.example.com/x?BaXgf=%26%7BY%5Dxt%25o&l0f=HM%5Cd%24JB%3E)&lDQ7a94=Xh%3AB3N1jK_&dzGNz3=Y8NX4o9%5BS&YnCMxDdTew=J%5B%7B~b%23&Mr8UpMhPo=H&8_nAwh8ZHe=9%5DRY%40V&EgheAy='Uk&gmqTwKW=7PyitIn&3=V%5EKApdS%2C
http://s.example.com/x?dBA7WswJ5=GX-x&yKHeb=1y1sq%3EjPt&7G=7oa%24XF%7C)jQ&FjVo5IpF=%3BZ%5C&JB7OLer=%7C55&bYo64Fiy=L%23%40&ZhSohJVZ=-W+Rp5c+%5DD&aP=zJP%7Bu&pE5URXCWq=PHZJ%60%3D97L&6Xw7Da7=.Drb