I'm just wondering something. Does anyone know / has anyone done any benchmarking on this ...
Basically, I have to use the HTML from a routine in more than one place per script install. Basically this means that I am passing the HTML too-and-from routines quite a lot.
Something like this;
use strict;
use LWP::Simple;
sub _test1 {
# --------------------------------------
my $got = get('http://www.perl.com') || die $!;
_test2($got);
}
sub _test2 {
# --------------------------------------
my $got = $_[0];
# do something to $got here
$got = s/\<b\>(.+?)\<\/b\>/$1/gi;
print "Content-type: text/html \n\n";
print $got;
}
Basically, I wan't to know if it would be better (in terms of large pages), to pass the URL through the routine, and simply reuse get() to grab the page...
...or...
Keep passing the HTML through to the routines (i.e. I'm not sure if it is quicker to pass a URL into the servers memory, and then do stuff to it... or send the URL, and regrab the page and start processing?)
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Basically, I have to use the HTML from a routine in more than one place per script install. Basically this means that I am passing the HTML too-and-from routines quite a lot.
Something like this;
Code:
#!/usr/bin/perl use strict;
use LWP::Simple;
sub _test1 {
# --------------------------------------
my $got = get('http://www.perl.com') || die $!;
_test2($got);
}
sub _test2 {
# --------------------------------------
my $got = $_[0];
# do something to $got here
$got = s/\<b\>(.+?)\<\/b\>/$1/gi;
print "Content-type: text/html \n\n";
print $got;
}
Basically, I wan't to know if it would be better (in terms of large pages), to pass the URL through the routine, and simply reuse get() to grab the page...
...or...
Keep passing the HTML through to the routines (i.e. I'm not sure if it is quicker to pass a URL into the servers memory, and then do stuff to it... or send the URL, and regrab the page and start processing?)
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!