CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Sending value to subroutine

 



daniel_lsl
Deleted

Apr 29, 2000, 11:30 AM

Post #1 of 3 (416 views)
Sending value to subroutine Can't Post

Hi I'm stuck at this problem and just can't move on. I hope someone can enligthen me on this. I'm using the LWP::Parallel::UserAgent module. How to send the value of $content to the subroutine abc. Really appreciate your help and time. Thanks.
_____________________________________________

package myUA;
use Exporter();
use LWP::Parallel::UserAgent qw(:CALLBACK);
@ISA = qw(LWP::Parallel::UserAgent Exporter);
@EXPORT = @LWP::Parallel::UserAgent::EXPORT_OK;

sub on_return {
($self, $request, $response, $entry) = @_;
if ($response->is_success) {
$url = $request->url;
if ($url =~ m/abc/) {
$content = $response->content;
&abc;
}
} else {
}
return;
}

package main;
...
...
sub abc {
...
...
}
____________________________________________


darian
Deleted

May 1, 2000, 1:55 AM

Post #2 of 3 (416 views)
Re: Sending value to subroutine [In reply to] Can't Post

Well if this is all in one script you should be able to just reference the $content variable since you haven't declared it local. Or you could do:
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

&abc($content);</pre><HR></BLOCKQUOTE>

Then reference $_[0] as this is where it is stored now. But I am not sure why you don't just reference the variable $content. Maybe I am missing something.


daniel_lsl
Deleted

May 2, 2000, 4:24 AM

Post #3 of 3 (416 views)
Re: Sending value to subroutine [In reply to] Can't Post

Thanks for your help. Yeah I'll reference it to as I did not think about that before.

Cheers.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives