--- Eric Chun <[EMAIL PROTECTED]> wrote:
> I've just seen a strange thing. I made up a simple perl program:
> #!/usr/local/perl -w
> my ($summary_data);
> $summary_data->{'express'} = "blahblahblah\n";
> print $summary_data->{'express'};
> Notice that $summary_data is not initialized, so when used as a
> reference, it will point to the memory address 0x0 because perl
> automatically gives undefined variables the value of zero.
No, Perl converts undef to zero in a numeric context.
This is a reference context, so I'm guessing it's autovivifying.
> My question is how can this work (i've tried it and it works)?
> I thought that no program can reference address 0x0 since it is
> protected by the OS?
It's not 0x0.
try changing the last line like so:
print $summary_data->{'express'}, ",$summary_data\n";
It'll stringify and show you $summary_data's new value.
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]