Re: Unable to connect a website using LWP




"Sisyphus" <sisyphus1@xxxxxxxxxxxxxxxxx> wrote in message


Not only that - but even Devel::Peek doesn't detect any difference between
the return value of 'q{}' and the return value of '5<3'. I ran this:

use warnings;
use Devel::Peek;

$x = q{};
if($x == 0) {print "OK1\n"}

$y = (5 < 3);
if($y == 0) {print "OK2\n"}

Dump($x);
print "##################\n";
Dump($y);
__END__

Do you know what accounts for the difference in behaviour ?


Doh ... silly me. As soon as the equivalence check is carried out on $x, its
flags are altered. The correct way to see the difference between $x and $y
is:

use warnings;
use Devel::Peek;

$x = q{};
$y = (5 < 3);

Dump($x);
print "##################\n";
Dump($y);
__END__

Which outputs:

SV = PV(0x3f5f74) at 0x3f5d94
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x3fd87c ""\0
CUR = 0
LEN = 4
##################
SV = PVNV(0x3f876c) at 0x3f5db8
REFCNT = 1
FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK)
IV = 0
NV = 0
PV = 0x8bfe84 ""\0
CUR = 0
LEN = 4

And therein lies the answer - $y already has its IOK flag set, but $x does
not.

Cheers,
Rob


.



Relevant Pages