-2

The problem I met is that I need to get one URL (I cannot be specific that link exactly, this link is doing request and looks like http://link.com/?name=name&password=password& and etc)

And I need to fetch this URL 100 times in a row. I can not do this manually using browser - this takes much time.

Is there any option to run (just run, like you put link in browser and press enter) this link 100 times in a row using Perl scripting?

I have not met before with the Perl and therefore asking the help directly. As I google before some information and make a little script, but seems like I missing something in my knowledge:

#!/usr/bin/perl -w

use LWP::Simple;
my $uri =  'http://my link here';
my $content = get $uri;

Could you please advise to me how I can finish this script?

melpomene
  • 84,125
  • 8
  • 85
  • 148

1 Answers1

1

Use a (simple) for loop.

#!/usr/bin/perl

use strict;
use warnings;

use LWP::Simple;
my $uri =  'http://my link here';
get $uri for 1 .. 100;

Update: Just read in a comment that you don't care about the returned data, so I've edited my answer to remove the unnecessary $content variable.

Dave Cross
  • 68,119
  • 3
  • 51
  • 97