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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

