On Mon, Feb 12, 2007 at 03:31:01PM +0800, Spark Shen wrote:
> Hi:
> 
> I am a fresh bird on perl. :-) Could gurus help me to understand this
> statement.
> 
> *HTTP::Request->new(GET => $url);*
> 
> How does perl parse the struct *GET => $url* here.
> 
> I found out GET is a method defined in HTTP::Request::Common. If *GET =>
> $url* is a method invocation here, what is the operator => stands for?
> What's it context? list or scalar?
> 
> IIRC, => is a hash operator used in hash array. But it apparently is not
> here.



HTTP::Request is a module. This is something that has been written to do 
generally complex 
procedures and saves other programmers from rewriting the same code

So HTTP::Request->new(GET => $url) means that

1. use the HTTP::Request module
2. use it to GET the URL assigned to $url 

You don't have to do any more coding

A little more detail is at 
http://search.cpan.org/~gaas/libwww-perl-5.805/lib/HTTP/Request.pm




Owen

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to