Hi,

I made the following test script:

use strict;
use warnings FATAL => 'all';
use LWP::UserAgent;

my $fields;

my $ua = LWP::UserAgent->new;
my $res = $ua->get( 'http://www.google.com/', %$fields );

This script runs with no errors, although the variable $fields is undefined and 
it is used as a hash reference and I don't understand why.

If I use it in the following line however, it gives the error "Can't use an 
undefined value as a HASH reference":
my %params = %$fields;

Does anyone have an explanation why in the first example it works fine?

Thanks.

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to