A few questions on LWP and GET - I put together this little script to show what I am talking about but it's not the actually script that will be using, the ideas are the same.
Now, if using the following script, how can I actually measure
#1 - The Size of the File or Page that the LWP module or GET command is actually retrieving
&
#2 - The actual time that it takes the server to get the file. I would like to be able to measure the speed in which the file or page is retrieved.
I am sure it's very easy but I can not find any reference to this anywhere.
Here is the example script -
############################
#!/usr/bin/perl
use strict;
use CGI;
use LWP::Simple;
my $in = new CGI;
# Either display the source code, the search form or do the search.
# We are searching, so get the query, escape it, and use LWP to search.
my $url = "$ENV{'QUERY_STRING'}";
my $results = get ($url);
print CGI->header;
print $results;
exit;
Any ideas?
Now, if using the following script, how can I actually measure
#1 - The Size of the File or Page that the LWP module or GET command is actually retrieving
&
#2 - The actual time that it takes the server to get the file. I would like to be able to measure the speed in which the file or page is retrieved.
I am sure it's very easy but I can not find any reference to this anywhere.
Here is the example script -
############################
#!/usr/bin/perl
use strict;
use CGI;
use LWP::Simple;
my $in = new CGI;
# Either display the source code, the search form or do the search.
# We are searching, so get the query, escape it, and use LWP to search.
my $url = "$ENV{'QUERY_STRING'}";
my $results = get ($url);
print CGI->header;
print $results;
exit;
Any ideas?